-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (76 loc) · 1.9 KB
/
test.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
name: test
on:
push:
branches:
- main
pull_request:
merge_group:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./tools/ci/github/setup
- run: tools/build.sh
- run: git diff --exit-code
- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: target/release/pen
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./tools/ci/github/setup
- run: tools/unit_test.sh
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./tools/ci/github/setup
- run: tools/coverage.sh
- uses: codecov/codecov-action@v5
with:
files: lcov.info
feature_test:
needs: build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
index: [0, 1, 2, 3, 4, 5, 6, 7]
total: [8]
exclude:
- os: ${{ github.ref == 'refs/heads/main' && 'none' || 'macos-latest' }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./tools/ci/github/setup
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.os }}
path: target/release
- run: chmod +x target/release/pen
- run: tools/integration_test.sh $(find features -name *.feature | sort | awk 'NR % ${{ matrix.total }} == ${{ matrix.index }}')
test:
needs:
- build
- unit_test
- coverage
- feature_test
if: always()
runs-on: ubuntu-latest
steps:
- run: for result in ${{ join(needs.*.result, ' ') }}; do [ $result = success ]; done