forked from spack/spack-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (93 loc) · 3.19 KB
/
unit_tests.yaml
File metadata and controls
99 lines (93 loc) · 3.19 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: unit tests
on:
workflow_dispatch:
workflow_call:
concurrency:
group: unit_tests-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true
jobs:
# Run unit tests with different configurations on linux
ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
on_develop:
- ${{ github.ref == 'refs/heads/develop' }}
include:
- python-version: '3.7'
os: ubuntu-22.04
on_develop: ${{ github.ref == 'refs/heads/develop' }}
exclude:
- python-version: '3.8'
os: ubuntu-latest
on_develop: false
- python-version: '3.9'
os: ubuntu-latest
on_develop: false
- python-version: '3.10'
os: ubuntu-latest
on_develop: false
- python-version: '3.11'
os: ubuntu-latest
on_develop: false
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: ${{ matrix.python-version }}
- name: Install System packages
run: |
sudo apt-get -y update
# Needed for unit tests
sudo apt-get -y install \
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
cmake bison libbison-dev subversion
- name: Install Python packages
run: pip install --upgrade pytest clingo
- uses: ./.github/actions/checkout-spack
- name: Run unit tests
run: PYTHONPATH="$PWD/spack-core/lib/spack" python3 -m pytest -v --exitfirst
# Run unit tests on MacOS
macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-15", "macos-15-intel"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: ${{ matrix.python-version }}
- name: Install Python packages
run: pip install --upgrade pytest clingo
- name: Setup Homebrew packages
run: brew install dash fish gcc gnupg
- uses: ./.github/actions/checkout-spack
- name: Run unit tests
run: PYTHONPATH="$PWD/spack-core/lib/spack" python3 -m pytest -v --exitfirst
# Run unit tests on Windows
windows:
defaults:
run:
shell:
powershell Invoke-Expression -Command "./.ci/windows_test_setup.ps1"; {0}
runs-on: windows-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: 3.9
- name: Install Python packages
run: python -m pip install --upgrade pywin32 pytest clingo
#- name: Create local develop
# run: |
# ./.github/workflows/bin/setup_git.ps1
- uses: ./.github/actions/checkout-spack
- name: Run unit tests
run: |
$Env:PYTHONPATH = "$Env:SPACK_ROOT\lib\spack;$Env:PYTHONPATH"
python3 -m pytest -v --exitfirst
./.ci/validate_last_exit.ps1