-
Notifications
You must be signed in to change notification settings - Fork 106
129 lines (109 loc) · 3.56 KB
/
ci-job.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
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
# Each sub-job is defined here. These jobs perform specific tasks such as linting, testing, or publishing
# based on the matrix parameters.
name: CI Job
on:
workflow_call:
inputs:
# "linux"
label:
required: true
type: string
# "ubuntu-latest"
os:
required: true
type: string
# "lint"
job:
required: true
type: string
is_main:
required: true
type: boolean
is_tag:
required: true
type: boolean
jobs:
job:
name: ${{ inputs.label }} ${{ inputs.job }}
runs-on: ${{ inputs.os }}
steps:
- run: echo ${{ inputs.job }}
# ************************************************************************************************
# BEGIN COMMON STEPS
# These steps are run for each and every sub-job, on a clean runner.
# ************************************************************************************
# TODO(mmastrac): these could be extracted to a `ci-common.yml`
- name: Clone repository
uses: actions/checkout@v4
- name: Install ARM runner tools
if: ${{ inputs.os == 'ubuntu-22.04-arm64' }}
run: |
# Installing packages
sudo rm /var/lib/man-db/auto-update || true
sudo apt update
sudo apt-get install -y --no-install-recommends unzip clang
- name: Install Rust
uses: dsherret/rust-toolchain-file@v1
- name: Install Deno
uses: denoland/setup-deno@v1
# https://github.com/marketplace/actions/rust-cache
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust"
shared-key: "${{ inputs.label }}-${{ inputs.job }}"
save-if: ${{ inputs.is_main }}
- name: Clean
if: inputs.is_main
run: cargo clean
# ************************************************************************************************
# END COMMON STEPS
# ************************************************************************************************
- name: No-op
id: nop
if: inputs.job == 'nop'
uses: ./.github/workflows/ci-nop
- name: Coverage
id: coverage
if: inputs.job == 'coverage'
uses: ./.github/workflows/ci-coverage
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Lint
id: lint
if: inputs.job == 'lint'
uses: ./.github/workflows/ci-lint
- name: Lint (deps)
id: lint-deps
if: inputs.job == 'lint-deps'
uses: ./.github/workflows/ci-lint-deps
- name: Test
id: test
if: inputs.job == 'test'
uses: ./.github/workflows/ci-test
- name: Test (ops)
id: test-ops
if: inputs.job == 'test-ops'
uses: ./.github/workflows/ci-test-ops
- name: Test (miri)
id: test-miri
if: inputs.job == 'test-miri'
uses: ./.github/workflows/ci-test-miri
- name: Test (valgrind)
id: test-valgrind
if: inputs.is_main && inputs.job == 'test-valgrind'
uses: ./.github/workflows/ci-test-valgrind
- name: Publish (dry-run)
id: test-publish
if: inputs.job == 'test-publish'
uses: ./.github/workflows/ci-test-publish
- name: Publish
id: publish
if: inputs.job == 'publish'
uses: ./.github/workflows/ci-publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
env:
CARGO_INCREMENTAL: 0
GH_ACTIONS: 1
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings