-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (60 loc) · 2.75 KB
/
CI_pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI on pull request
on:
pull_request:
branches:
- main
schedule:
- cron: '15 2 * * TUE' # Also run the full test suite for PRs on the main branch every Tuesday night
jobs:
run-full-test-suite:
name: Run full test suite
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
singularity-provider: ["singularity", "apptainer"]
include:
- singularity-provider: "singularity"
singularity-version: "3.8.7"
- singularity-provider: "apptainer"
singularity-version: "1.1.3"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Attempt to restore Singularity/Apptainer installer from cache
uses: actions/cache@v3
id: cache-singularity-installer
with:
path: ./singularity_installer.deb
key: ${{ matrix.os }}-${{ matrix.singularity-provider }}_installer-${{ matrix.singularity-version }}
- name: Download Singularity ${{ matrix.singularity-version }}
if: ${{ steps.cache-singularity-installer.outputs.cache-hit != 'true' && matrix.singularity-provider == 'singularity' }}
run: wget -O singularity_installer.deb https://github.com/apptainer/singularity/releases/download/v${{ matrix.singularity-version }}/singularity-container_${{ matrix.singularity-version }}_amd64.deb
- name: Downlaod Apptainer ${{ matrix.apptainer-version }}
if: ${{ steps.cache-singularity-installer.outputs.cache-hit != 'true' && matrix.singularity-provider == 'apptainer' }}
run: wget -O singularity_installer.deb https://github.com/apptainer/apptainer/releases/download/v${{ matrix.singularity-version }}/apptainer_${{ matrix.singularity-version }}_amd64.deb
- name: Set up Singularity/Apptainer
run: |
sudo apt install ./singularity_installer.deb
singularity --version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/test-requirements.txt"
- name: Install test dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r test-requirements.txt
- name: Run test suite via pytest
run: pytest -vv --junitxml=pytest_junit_out.xml
- name: Archive the test results and coverage
uses: actions/upload-artifact@v3
with:
name: test-results-and-coverage_python${{ matrix.python-version }}_${{ matrix.singularity-provider }}${{ matrix.singularity-version }}
path: |
pytest_junit_out.xml
htmlcov/*