-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (102 loc) · 3.64 KB
/
rust.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
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: .github/workflows/build.sh
checks:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
# We lock our failing tests on a known good version and
# informationally check the latest as well. We should
# regularly update the known good once we know that tests
# pass on it
rust-toolchain: [ 1.72, stable, nightly ]
steps:
- uses: actions/checkout@v3
- name: Setup
run: .github/workflows/restore-checks.sh ${{ matrix.rust-toolchain }}
- name: Check format
run: .github/workflows/format.sh ${{ matrix.rust-toolchain }}
- name: Check clippy
id: clippy
run: .github/workflows/clippy.sh ${{ matrix.rust-toolchain }}
continue-on-error: ${{ matrix.rust-toolchain != '1.72' }}
- name: Store clippy flag
if: (matrix.rust-toolchain != '1.72')
run: |
mkdir -p ./clippy-${{ matrix.rust-toolchain }}
if [[ ${{ steps.clippy.outcome }} == "success" ]] ; then \
echo 0 > ./clippy-${{ matrix.rust-toolchain }}/flag; \
else \
echo 1 > ./clippy-${{ matrix.rust-toolchain }}/flag; \
fi
echo ${{ github.event.number }} > ./clippy-${{ matrix.rust-toolchain }}/issue_num
- uses: actions/upload-artifact@v3
if: (matrix.rust-toolchain != '1.72')
with:
name: clippy-${{ matrix.rust-toolchain }}
path: clippy-${{ matrix.rust-toolchain }}/
- name: Check docs
run: .github/workflows/doc.sh ${{ matrix.rust-toolchain }}
- name: Build release
run: .github/workflows/build-release.sh
test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
# 2.7 is the version in Ubuntu 18.04
# 3.0 is the version in Ubuntu 20.04
# 2.9 and earlier do not yet support policy.32 and
# we default to policy.32 for now. Once we support
# configurable policy versions, we should be able to successfully
# test against 2.7-2.9
selinux-version: [ secilc-3.0, secilc-3.1, 3.2, 3.3, 3.4, 3.5 ]
rust-toolchain: [ stable ]
include:
- selinux-version: '3.5'
rust-toolchain: nightly
steps:
- uses: actions/checkout@v3
- name: Checkout selinux userspace
uses: actions/checkout@v3
with:
repository: SELinuxProject/selinux
ref: refs/tags/${{ matrix.selinux-version }}
path: selinux
- name: Setup
run: .github/workflows/restore-test.sh ${{ matrix.rust-toolchain }}
- name: Run tests
id: test
run: .github/workflows/test.sh ${{ matrix.rust-toolchain }}
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
- name: Store nightly flag
if: (matrix.rust-toolchain == 'nightly')
run: |
mkdir -p ./test-${{ matrix.rust-toolchain }}
if [[ ${{ steps.test.outcome }} == "success" ]] ; then \
echo 0 > ./test-${{ matrix.rust-toolchain }}/nightly_flag; \
else \
echo 1 > ./test-${{ matrix.rust-toolchain }}/nightly_flag; \
fi
# Note, unlike above we are not storing issue_num in this artifact.
# That is because it will be stored in the clippy artifact and both
# get unzipped if the toolchain is nightly.
- uses: actions/upload-artifact@v3
if: (matrix.rust-toolchain == 'nightly')
with:
name: test-${{ matrix.rust-toolchain }}
path: test-${{ matrix.rust-toolchain }}/