-
Notifications
You must be signed in to change notification settings - Fork 91
88 lines (83 loc) · 3.41 KB
/
testing-all-oses.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
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
name: Test MSS
on:
push:
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["macos-12", "macos-14", "ubuntu-latest", "windows-latest"]
order: ["normal", "reverse"]
headless-method: ["env QT_QPA_PLATFORM=offscreen"]
include:
- os: "ubuntu-latest"
order: "normal"
headless-method: "xvfb-run"
- os: "ubuntu-latest"
order: "reverse"
headless-method: "xvfb-run"
steps:
# This workaround is necessary because PyFilesystem2 throws an InvalidCharsInPath error:
# fs.errors.InvalidCharsInPath: path 'C:/Users/RUNNER~1/AppData/Local/Temp/tmp4hu4dmfwmsui546ffd7ad0/colabTestData/uploads/1' contains invalid characters
# This is caused by the short name conversion ("RUNNER~1").
# The workaround is described here: https://github.com/actions/runner-images/issues/712#issuecomment-613004302
- name: Workaround for TMP and TEMP path on Windows
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
- name: Workaround for TMPDIR in MacOS 12
if: ${{ matrix.os == 'macos-12' }}
run: echo "TMPDIR=/private$TMPDIR" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Build requirements.txt file
run: |
cat localbuild/meta.yaml |
sed -n '/^requirements:/,/^test:/p' |
sed -e "s/.*- //" |
sed -e "s/menuinst.*//" |
sed -e "s/.*://" > requirements.tmp.txt
cat requirements.d/development.txt >> requirements.tmp.txt
sed -e '/^$/d' -e '/^#.*$/d' requirements.tmp.txt > requirements.txt
rm requirements.tmp.txt
cat requirements.txt
- name: Remove unavailable dependencies on Windows
if: ${{ startsWith(matrix.os, 'windows') }}
run: sed -i -e '/^dbus-python.*$/d' -e '/^libxmlsec1.*$/d' requirements.txt
- name: Get current year and calendar week
id: year-and-week
run: echo "year-and-week=$(date +%Y-%V)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: requirements.txt
environment-name: ci
cache-environment: true
# Set the cache key in a way that the cache is invalidated every week on monday
cache-environment-key: environment-${{ steps.year-and-week.outputs.year-and-week }}
- name: Run tests
timeout-minutes: 20
run: micromamba run -n ci ${{ matrix.headless-method }} pytest -v -s -n logical --durations=20 --cov=mslib
${{ (matrix.order == 'normal' && ' ') || (matrix.order == 'reverse' && '--reverse') }} tests
- name: Collect coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ join(matrix.*, ' - ') }}
COVERALLS_PARALLEL: true
run: |
git config --global --add safe.directory /__w/MSS/MSS
micromamba create -n coveralls coveralls
micromamba run -n coveralls coveralls --service=github
coveralls:
name: Indicate completion to coveralls.io
if: ${{ !cancelled() }}
needs: test
runs-on: ubuntu-latest
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}