-
Notifications
You must be signed in to change notification settings - Fork 12
80 lines (74 loc) · 2.2 KB
/
tests.yaml
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
name: tests
on:
pull_request:
branches:
- "*"
push:
branches:
- "master"
jobs:
changes:
name: Checking changed files
runs-on: ubuntu-latest
outputs:
keepgoing: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
*.{yaml,yml,py,toml}
**/*.{yaml,yml,py,toml}
tests
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
echo ${{ steps.changed-files.outputs.any_changed }}
tests:
needs:
- changes
if: needs.changes.outputs.keepgoing == 'true'
timeout-minutes: 720
defaults:
run:
shell: bash -l {0}
strategy:
max-parallel: 6
matrix:
environment: [py310, py311, py312]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Build and test
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Pixi Environment
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.environment }}
pixi-version: v0.39.2
cache: false
- name: Test build, unit tests
run: |
pixi run -e ${{ matrix.environment }} test
- name: Show coverage
if: matrix.os == 'ubuntu-latest' && matrix.environment == 'py312'
run: |
pixi run -e ${{ matrix.environment }} coverage
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.environment == 'py312' && github.actor != 'dependabot[bot]' && github.actor == 'zktuong'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: ${{ format('OS={0},PYTHON={1}', matrix.os, matrix.environment) }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true