-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (58 loc) · 1.69 KB
/
build-and-test-linux.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
name: Linux x86_64
on:
pull_request:
workflow_dispatch:
jobs:
build_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: setup rust stable
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: unit tests
run: |
cargo test --all --release
- name: upload bundle
uses: actions/upload-artifact@v4
with:
name: linux-x86_64-ubuntu-20.04
path: target/release/busser
build_test_with_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup rust stable
run: curl https://sh.rustup.rs -sSf | sh -s -- -y && cargo install cargo-tarpaulin
- name: unit tests
run: |
cargo build --release && cargo tarpaulin --out json --exclude-files tests/**
- name: upload bundle
uses: actions/upload-artifact@v4
with:
name: linux-x86_64-lastest
path: target/release/busser
- name: upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: tarpaulin-report.json
- name: Generate summary
id: summary
run: |
{
echo 'SUMMARY<<EOF'
python3 .github/workflows/report.py -r github/JerboaBurrow/Busser -m main --human
echo EOF
} >> "$GITHUB_ENV"
- name: Notify coverage
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BURROW_BOT }}
script: |
const { SUMMARY } = process.env
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${SUMMARY}`
})