Repository navigation
137 lines (128 loc) · 4.9 KB
/
Copy pathreports.yml
File metadata and controls
137 lines (128 loc) · 4.9 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
name: Reports
# Observatory reports: size, coverage and compile time of the CLI.
# Each job writes one JSON report and uploads it; the `publish` job commits
# them all to the `reports` branch, only from `main` or a manual run. On a
# pull request it runs only when this workflow changes (everything but the
# publish, so the change is proven before it merges); a push to the default
# branch measures every change.
on:
push:
branches: [main]
pull_request:
paths:
- '.github/workflows/reports.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
size:
name: size
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- id: rustc
run: echo "version=$(rustc --version)" >> "$GITHUB_OUTPUT"
- name: Build
run: |
cargo build --locked --release
- uses: ComlineProject/observatory/.github/actions/report-size@6544a11bdfb9e4def0a64d6cff1cf8c3df464951 # v1
with:
output: reports/cli.size.json
toolchain: ${{ steps.rustc.outputs.version }}
artifacts: |
cli/x86_64-linux-release=target/release/comline
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-size
path: reports/cli.size.json
if-no-files-found: error
coverage:
name: coverage
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- uses: ComlineProject/observatory/.github/actions/report-rust-coverage@6544a11bdfb9e4def0a64d6cff1cf8c3df464951 # v1
with:
output: reports/cli.coverage.json
args: --workspace
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-coverage
path: reports/cli.coverage.json
if-no-files-found: error
compile:
name: compile time
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: ComlineProject/observatory/.github/actions/report-rust-compile@6544a11bdfb9e4def0a64d6cff1cf8c3df464951 # v1
with:
output: reports/cli.compile.json
args: --workspace --release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-compile
path: reports/cli.compile.json
if-no-files-found: error
publish:
name: publish
needs: [size, coverage, compile]
if: github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
# The one checkout that keeps its credentials: publish-report pushes.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: report-*
path: reports
merge-multiple: true
- uses: ComlineProject/observatory/.github/actions/publish-report@6544a11bdfb9e4def0a64d6cff1cf8c3df464951 # v1
with:
reports: reports/cli.size.json reports/cli.coverage.json reports/cli.compile.json
readme: .github/reports-branch.md