Skip to content

Commit 5192fcd

Browse files
committed
ci: use common andyl-github-action for cache/devenv setup
1 parent be0d75e commit 5192fcd

File tree

2 files changed

+49
-46
lines changed

2 files changed

+49
-46
lines changed

.github/workflows/cron.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@ jobs:
1414
cron-coverage:
1515
strategy:
1616
matrix:
17-
os: [ ubuntu-latest-16 ]
17+
os: [ubuntu-latest-16]
1818
runs-on: ${{ matrix.os }}
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: cachix/install-nix-action@v26
22-
- uses: cachix/cachix-action@v14
23-
with:
24-
name: devenv
25-
- name: Install devenv.sh
26-
run: nix profile install nixpkgs#devenv
27-
- uses: Swatinem/rust-cache@v2
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
23+
- name: Setup devenv
24+
uses: andyl-technologies/andyl-github-action/setup-devenv@master
25+
26+
- name: Setup Rust cache
27+
uses: andyl-technologies/andyl-github-action/rust-cache@master
2828
with:
29-
save-if: true
3029
cache-all-crates: true
31-
- uses: taiki-e/install-action@cargo-llvm-cov
30+
save-condition: true
31+
3232
- name: Run coverage
3333
run: devenv shell wasm-trampoline-coverage
34-
- uses: clearlyip/code-coverage-report-action@v5
34+
35+
- name: Generate coverage report
36+
uses: clearlyip/code-coverage-report-action@v5
3537
with:
36-
filename: 'coverage.cobertura.xml'
38+
filename: 'coverage.cobertura.xml'

.github/workflows/test.yaml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,73 @@
1-
name: "Run Tests"
1+
name: 'Run Tests'
22

33
on:
44
pull_request:
55
push:
6-
branches: [ master ]
6+
branches: [master]
77

88
permissions:
9-
actions: write
9+
actions: read
1010
contents: write
1111
pull-requests: write
1212

1313
jobs:
1414
tests:
1515
env:
16-
SCCACHE_GHA_ENABLED: "true"
17-
RUSTC_WRAPPER: "sccache"
18-
CARGO_INCREMENTAL: "0"
16+
SCCACHE_GHA_ENABLED: 'true'
17+
RUSTC_WRAPPER: 'sccache'
18+
CARGO_INCREMENTAL: '0'
1919
strategy:
2020
matrix:
21-
os: [ ubuntu-latest-16 ]
21+
os: [ubuntu-latest-16]
2222
runs-on: ${{ matrix.os }}
2323

2424
steps:
25-
- uses: actions/checkout@v4
26-
- uses: cachix/install-nix-action@v26
27-
- uses: cachix/cachix-action@v14
28-
with:
29-
name: devenv
30-
- name: sccache
31-
uses: Mozilla-Actions/sccache-action@main
32-
- uses: Swatinem/rust-cache@v2
25+
- name: Checkout repo
26+
uses: actions/checkout@v4
27+
28+
- name: Setup devenv
29+
uses: andyl-technologies/andyl-github-action/setup-devenv@master
30+
31+
- name: Setup Rust cache
32+
uses: andyl-technologies/andyl-github-action/rust-cache@master
3333
with:
3434
cache-all-crates: true
35-
save-if: ${{ github.ref == 'refs/heads/master' }}
36-
37-
- name: Install devenv.sh
38-
run: nix profile install nixpkgs#devenv
35+
use-ccache: true
3936

4037
- name: Run tests
4138
run: devenv test
4239

4340
coverage:
4441
strategy:
4542
matrix:
46-
os: [ ubuntu-latest ]
43+
os: [ubuntu-latest]
4744
runs-on: ${{ matrix.os }}
4845
steps:
49-
- uses: actions/checkout@v4
50-
- uses: cachix/install-nix-action@v26
51-
- uses: cachix/cachix-action@v14
52-
with:
53-
name: devenv
54-
- name: Install devenv.sh
55-
run: nix profile install nixpkgs#devenv
56-
- uses: Swatinem/rust-cache@v2
57-
- uses: taiki-e/install-action@cargo-llvm-cov
58-
- name: Run coverage
46+
- name: Checkout repo
47+
uses: actions/checkout@v4
48+
49+
- name: Setup devenv
50+
uses: andyl-technologies/andyl-github-action/setup-devenv@master
51+
52+
- name: Setup Rust cache
53+
uses: andyl-technologies/andyl-github-action/rust-cache@master
54+
55+
- name: Run coverage tests
5956
run: devenv shell wasm-trampoline-coverage
60-
- name: Generate Coverage Report
57+
58+
- name: Generate coverage report
6159
uses: clearlyip/code-coverage-report-action@v5
6260
id: code_coverage_report_action
6361
if: ${{ github.actor != 'dependabot[bot]'}}
6462
with:
6563
filename: 'coverage.cobertura.xml'
6664
artifact_download_workflow_names: '"Run Tests",cron'
67-
- name: Add Coverage PR Comment
65+
66+
- name: Add coverage PR comment
6867
uses: marocchino/sticky-pull-request-comment@v2
69-
if: steps.code_coverage_report_action.outputs.file != '' && github.event_name == 'pull_request' && (success() || failure())
68+
if:
69+
steps.code_coverage_report_action.outputs.file != '' &&
70+
github.event_name == 'pull_request' && (success() || failure())
7071
with:
7172
recreate: true
7273
path: code-coverage-results.md

0 commit comments

Comments
 (0)