-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (125 loc) · 3.58 KB
/
pull_requests.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
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
name: pull_requests
on:
pull_request:
types: [assigned, opened, synchronize, edited]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: "${{ matrix.os }}"
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup rust
run: |
rustup toolchain install nightly
rustup default nightly
- name: build
run: cargo build
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup rust
run: |
rustup toolchain install nightly
rustup default nightly
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: test
run: cargo llvm-cov nextest --ignore-filename-regex nova-api --all --benches --lcov --output-path lcov.info
- name: upload code coverage
uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
test-incremental-mutants:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- uses: taiki-e/install-action@v2
with:
tool: cargo-mutants,cargo-nextest
- name: generate diff
continue-on-error: true
run: |
git branch -av
git diff origin/${{ github.base_ref }}.. | tee git.diff
- run: cargo mutants --test-tool=nextest -vV --in-diff git.diff
- uses: actions/upload-artifact@v4
with:
path: mutants.out
name: mutants
overwrite: true
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup rust
run: |
rustup toolchain install nightly
rustup default nightly
- name: bench
run: cargo bench > bench.txt
- name: upload bench
uses: actions/upload-artifact@v4
with:
path: bench.txt
name: benchmarks
overwrite: true
update-pr:
if: always()
needs:
- test-incremental-mutants
- bench
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup rust
run: |
rustup toolchain install nightly
rustup default nightly
- name: download bench
uses: actions/download-artifact@v4
with:
name: benchmarks
- name: download mutants
uses: actions/download-artifact@v4
with:
name: mutants
- name: prep benchmark comment
run: |
echo "## Benchmark Results" > results.txt
echo '```sh' >> results.txt
cat bench.txt >> results.txt
echo '```' >> results.txt
echo "## Possible Bugs" >> results.txt
echo '```' >> results.txt
cat mutants.out/missed.txt >> results.txt
echo '```' >> results.txt
- name: update pr comment
uses: thollander/actions-comment-pull-request@v2
with:
filePath: results.txt
comment_tag: execution