-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test running tests directly on action runner
To be able to test on different systems.
- Loading branch information
Showing
8 changed files
with
192 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,98 @@ | ||
--- | ||
name: Tests | ||
|
||
on: # yamllint disable-line rule:truthy | ||
- push | ||
- pull_request | ||
- workflow_dispatch | ||
|
||
env: | ||
SC_VER: "0.10.0" | ||
ESH_VER: "0.3.2" | ||
|
||
jobs: | ||
Tests: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- ubuntu-24.04 | ||
- macos-13 | ||
- macos-15 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Tests | ||
run: make test | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies on Linux | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y expect | ||
if [ "$MATRIX_OS" != "ubuntu-20.04" ]; then | ||
sudo apt-get install -y j2cli | ||
fi | ||
- name: Install dependencies on macOS | ||
if: ${{ runner.os == 'macOS' }} | ||
run: | | ||
brew install expect | ||
- name: Prepare tools directory | ||
run: | | ||
mkdir "$RUNNER_TEMP/tools" | ||
echo "$RUNNER_TEMP/tools" >> "$GITHUB_PATH" | ||
- name: Install shellcheck | ||
run: | | ||
if [ "$RUNNER_OS" = "macOS" ]; then | ||
OS=darwin | ||
else | ||
OS=linux | ||
fi | ||
if [ "$RUNNER_ARCH" = "ARM64" ]; then | ||
ARCH=aarch64 | ||
else | ||
ARCH=x86_64 | ||
fi | ||
cd "$RUNNER_TEMP" | ||
BASE_URL="https://github.com/koalaman/shellcheck/releases/download" | ||
SC="v$SC_VER/shellcheck-v$SC_VER.$OS.$ARCH.tar.xz" | ||
curl -L "$BASE_URL/$SC" | tar Jx shellcheck-v$SC_VER/shellcheck | ||
mv shellcheck-v$SC_VER/shellcheck tools | ||
- name: Install esh | ||
run: | | ||
cd "$RUNNER_TEMP/tools" | ||
BASE_URL="https://github.com/jirutka/esh/raw/refs/tags" | ||
curl -L -o esh "$BASE_URL/v$ESH_VER/esh" | ||
chmod +x esh | ||
- name: Add old yadm versions # to test upgrades | ||
run: | | ||
for version in 1.12.0 2.5.0; do | ||
git fetch origin $version:refs/tags/$version | ||
git cat-file blob $version:yadm > "$RUNNER_TEMP/tools/yadm-$version" | ||
chmod +x "$RUNNER_TEMP/tools/yadm-$version" | ||
done | ||
- name: Set up Python 3.11 | ||
if: ${{ runner.os == 'macOS' }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r test/requirements.txt | ||
- name: Run tests | ||
run: | | ||
git config --global user.email test@yadm.io | ||
git config --global user.name "Yadm Test" | ||
pytest -v --color=yes --basetemp="$RUNNER_TEMP/pytest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
.testyadm | ||
_site | ||
testenv | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.