-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (83 loc) · 2.31 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
report:
needs:
- lint-aux
- rustfmt
- clippy
- build-and-test
if: always()
runs-on: ubuntu-20.04
steps:
- name: Report success
if: "!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')"
run: exit 0
- name: Report failure
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')"
run: exit 1
lint-aux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./ci/install-lint-deps.sh
- name: Run auxilary lints
run: ./ci/lint-aux.sh
rustfmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable.txt --profile minimal -c rustfmt
- name: Run rustfmt
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh stable.txt --profile minimal -c clippy
- name: Run clippy
run: ./ci/clippy.sh
build-and-test:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- rust-version: msrv.txt
- rust-version: stable.txt
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal
- name: Build and test
run: ./ci/build-and-test.sh
build-dist:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- image: quay.io/pypa/manylinux2014_x86_64
command: bash -c ./ci/build-disk-linux.sh x86_64-unknown-linux-gnu
output: target/release/rsjsonnet
artifact: rsjsonnet_linux-x86_64
steps:
- uses: actions/checkout@v4
- name: Pull image
run: docker pull ${{ matrix.image }}
- name: Build
run: |
docker run \
-v "$(pwd):/workdir" \
-w /workdir \
${{ matrix.image }} \
${{ matrix.command }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.output }}
if-no-files-found: error