Repository navigation
85 lines (79 loc) · 3.61 KB
/
Copy pathci.yml
File metadata and controls
85 lines (79 loc) · 3.61 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
# The job runs `just ci` in the flake's `ci` dev shell, which pins everything the tests touch: the
# Rust toolchain, GNU R 4.6.2 as the oracle recorded it, the compiler, glibc and the locales. To
# change what CI runs or what it runs on, edit the `ci` recipe in the justfile or the shell in
# flake.nix, not this file. It runs when started by hand (user decision: the orchestrating agent
# starts it on main at its hourly check when main has new commits) and inside a release, which calls
# it, so nothing is published from a commit that fails it. The `stress` job runs `just ci-stress`
# in the same shell, once per seed.
name: CI
on:
workflow_dispatch:
workflow_call:
# Inside a release `github.workflow` is the release's name, so the prefix keeps this group apart
# from any group of the caller's.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
gate:
name: fmt + clippy + tests
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
# `just unsafe` measures each file's `unsafe` count against the first version of
# tools/unsafe-baseline.txt, which a shallow checkout does not have.
- uses: actions/checkout@v4
with:
fetch-depth: 0
# The Nix store, the test build and base R need more disk than the runner has free.
- name: free disk space
run: sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
- uses: cachix/install-nix-action@v31
# Pulls the shell's GNU R from ry.cachix.org and pushes it when this run had to build it. The
# filter keeps out the Rust toolchain, which static.rust-lang.org serves faster than a
# rebuild, and crane's dependency build.
- uses: cachix/cachix-action@v17
with:
name: ry
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
pushFilter: "-ry-deps-|-rust-|-rustc-|-cargo-|-clippy-|-rustfmt-|-llvm-tools-"
# rust-cache keys and prunes the cargo cache with the toolchain on PATH, so the shell's goes
# first.
- name: toolchain on PATH
run: nix develop .#ci -c bash -c 'dirname "$(command -v cargo)"' >> "$GITHUB_PATH"
- uses: Swatinem/rust-cache@v2
- name: just ci
run: nix develop .#ci -c just ci
stress:
name: collection stress, seed ${{ matrix.seed }}
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
seed: [0, 1, 2]
steps:
- uses: actions/checkout@v4
# The Nix store, the test build and base R need more disk than the runner has free.
- name: free disk space
run: sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
- uses: cachix/install-nix-action@v31
# Pulls the shell's GNU R from ry.cachix.org and pushes it when this run had to build it. The
# filter keeps out the Rust toolchain, which static.rust-lang.org serves faster than a
# rebuild, and crane's dependency build.
- uses: cachix/cachix-action@v17
with:
name: ry
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
pushFilter: "-ry-deps-|-rust-|-rustc-|-cargo-|-clippy-|-rustfmt-|-llvm-tools-"
# rust-cache keys and prunes the cargo cache with the toolchain on PATH, so the shell's goes
# first.
- name: toolchain on PATH
run: nix develop .#ci -c bash -c 'dirname "$(command -v cargo)"' >> "$GITHUB_PATH"
- uses: Swatinem/rust-cache@v2
- name: just ci-stress
run: nix develop .#ci -c just ci-stress ${{ matrix.seed }}