Skip to content

Commit

Permalink
Test running tests on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
erijo committed Jan 8, 2025
1 parent 1d69ce3 commit 32d472f
Showing 1 changed file with 42 additions and 17 deletions.
59 changes: 42 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-24.04
- macos-13
- macos-15
# - ubuntu-20.04
# - ubuntu-24.04
# - macos-13
# - macos-15
- windows-2022
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- uses: Vampire/setup-wsl@v4
if: ${{ runner.os == 'Windows' }}

- name: Install dependencies on Linux
if: ${{ runner.os == 'Linux' }}
run: |
Expand All @@ -38,26 +45,33 @@ jobs:
run: |
command -v expect || brew install expect
- name: Install dependencies on Windows (WSL)
if: ${{ runner.os == 'Windows' }}
shell: wsl-bash {0}
run: |
apt-get update
apt-get install --no-install-recommends -y curl expect git j2cli python3-pip
- name: Prepare tools directory
run: |
mkdir "$RUNNER_TEMP/tools"
echo "$RUNNER_TEMP/tools" >> "$GITHUB_PATH"
mkdir "${{ runner.temp }}/tools"
echo "${{ runner.temp }}/tools" >> "${{ github.path }}"
- name: Install shellcheck
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
if [ "${{ runner.os }}" = "macOS" ]; then
OS=darwin
else
OS=linux
fi
if [ "$RUNNER_ARCH" = "ARM64" ]; then
if [ "${{ runner.arch }}" = "ARM64" ]; then
ARCH=aarch64
else
ARCH=x86_64
fi
cd "$RUNNER_TEMP"
cd "${{ runner.temp }}"
BASE_URL="https://github.com/koalaman/shellcheck/releases/download"
SC="v$SC_VER/shellcheck-v$SC_VER.$OS.$ARCH.tar.xz"
Expand All @@ -66,7 +80,7 @@ jobs:
- name: Install esh
run: |
cd "$RUNNER_TEMP/tools"
cd "${{ runner.temp }}/tools"
BASE_URL="https://github.com/jirutka/esh/raw/refs/tags"
curl -L -o esh "$BASE_URL/v$ESH_VER/esh"
Expand All @@ -76,8 +90,8 @@ jobs:
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"
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
Expand All @@ -86,13 +100,24 @@ jobs:
with:
python-version: 3.11

- name: Install Python dependencies
- name: Install dependencies and run tests
if: ${{ runner.os != 'Windows' }}
run: |
python -m pip install --upgrade pip
python -m pip install -r test/requirements.txt
git config --global user.email [email protected]
git config --global user.name "Yadm Test"
python3 -m pip install --upgrade pip
python3 -m pip install -r test/requirements.txt
pytest -v --color=yes --basetemp="${{ runner.temp }}/pytest"
- name: Run tests
- name: Install dependencies and run tests
if: ${{ runner.os == 'Windows' }}
shell: wsl-bash {0}
run: |
env
git config --global user.email [email protected]
git config --global user.name "Yadm Test"
pytest -v --color=yes --basetemp="$RUNNER_TEMP/pytest"
python3 -m pip install --upgrade pip
python3 -m pip install -r test/requirements.txt
pytest -v --color=yes

0 comments on commit 32d472f

Please sign in to comment.