Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,60 @@ jobs:
name: coverage-reports-unit-${{ matrix.platform }}-${{ matrix.python-version }}
path: ./coverage.xml

unit-tests-wsl:
name: Run unit tests on the Windows Subsystem for Linux
needs: [linting]
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: windows-latest
defaults:
run:
shell: wsl-bash {0}
steps:
- uses: Vampire/setup-wsl@v3
with:
distribution: Ubuntu-22.04
- uses: actions/checkout@v4
# - uses: Ubuntu/WSL/.github/actions/wsl-checkout@main #?
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: pip install poetry

- name: Install dependencies
run: poetry install --with=dev

- name: Setup passwordless SSH access to localhost for tests
# Adapted from https://stackoverflow.com/a/60367309/6388696
run: |
ssh-keygen -t ed25519 -f ~/.ssh/testkey -N ''
cat > ~/.ssh/config <<EOF
Host localhost
User $USER
HostName 127.0.0.1
IdentityFile ~/.ssh/testkey
EOF
echo -n 'from="127.0.0.1" ' | cat - ~/.ssh/testkey.pub > ~/.ssh/authorized_keys
chmod og-rw ~
ssh -o 'StrictHostKeyChecking no' localhost id

- name: Test with pytest
run: poetry run pytest --cov=milatools --cov-report=xml --cov-append

- name: Store coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: coverage-reports-unit-WSL-${{ matrix.python-version }}
path: ./coverage.xml


mock-slurm-integration-tests:
name: integration tests with a mock slurm cluster
needs: [unit-tests]
needs: [unit-tests, unit-tests-wsl]
runs-on: ${{ matrix.platform }}

strategy:
Expand Down