-
-
Notifications
You must be signed in to change notification settings - Fork 42
161 lines (154 loc) · 6.09 KB
/
Copy pathtests.yml
File metadata and controls
161 lines (154 loc) · 6.09 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Tests
on: [ push, pull_request ]
permissions:
contents: read # to fetch code (actions/checkout)
# env:
# CCACHE_DIR: "${{ github.workspace }}/.ccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
coverage:
name: Release + Coverage ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.76.1
cache: true
cache-key: coverage-v1-
environments: coverage
# - name: Prepare compiler cache
# id: prep-ccache
# shell: bash
# run: |
# mkdir -p "${CCACHE_DIR}"
# echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT
# NOW=$(date -u +"%F-%T")
# echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
# - name: Setup compiler cache
# uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# id: cache-ccache
# with:
# path: ${{ steps.prep-ccache.outputs.dir }}
# key: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-release-${{ steps.prep-ccache.outputs.timestamp }}
# restore-keys: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-release-
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
fi
shell: bash
- name: Run tests
run: pixi run --environment=coverage tests $NUM_WORKERS
- name: Generate coverage report
run: pixi run --skip-deps coverage
- name: Upload HTML coverage report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cov-html-${{ matrix.runs-on }}
path: .pixi/envs/coverage/share/xsf/cov/coverage_report/**
# - name: Ccache performance
# shell: bash -l {0}
# run: pixi run ccache -s
tests-release:
# for platforms without coverage support
name: Release
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [windows-latest]
environment: [tests-release]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.76.1
cache: true
cache-key: release-v1-
environments: ${{ matrix.environment }}
# - name: Prepare compiler cache
# id: prep-ccache
# shell: bash
# run: |
# mkdir -p "${CCACHE_DIR}"
# echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT
# NOW=$(date -u +"%F-%T")
# echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
# - name: Setup compiler cache
# uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# id: cache-ccache
# with:
# path: ${{ steps.prep-ccache.outputs.dir }}
# key: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-release-${{ steps.prep-ccache.outputs.timestamp }}
# restore-keys: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-release-
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "NUM_WORKERS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV"
fi
shell: bash
- name: Run tests
run: pixi run --environment=${{ matrix.environment }} tests $NUM_WORKERS
# - name: Ccache performance
# shell: bash -l {0}
# run: pixi run ccache -s
tests-debug:
name: Debug ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, ubuntu-24.04-arm]
environment: [tests-debug]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.76.1
cache: true
cache-key: tests-debug-v2-
environments: ${{ matrix.environment }}
log-level: vvv
# - name: Prepare compiler cache
# id: prep-ccache
# shell: bash
# run: |
# mkdir -p "${CCACHE_DIR}"
# echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT
# NOW=$(date -u +"%F-%T")
# echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
# - name: Setup compiler cache
# uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# id: cache-ccache
# with:
# path: ${{ steps.prep-ccache.outputs.dir }}
# key: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-debug-${{ steps.prep-ccache.outputs.timestamp }}
# restore-keys: v4-${{ github.workflow }}-ccache-${{ matrix.runs-on }}-debug-
- name: Determine number of workers
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "NUM_WORKERS=$(nproc)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo "NUM_WORKERS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
echo "NUM_WORKERS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV"
fi
shell: bash
- name: Run tests
run: pixi run --environment=${{ matrix.environment }} tests $NUM_WORKERS
# - name: Ccache performance
# shell: bash -l {0}
# run: pixi run ccache -s