-
Notifications
You must be signed in to change notification settings - Fork 9
80 lines (72 loc) · 1.82 KB
/
cocl_basic_ci.yaml
File metadata and controls
80 lines (72 loc) · 1.82 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
name: Basic CI test for Rust
on:
pull_request:
branches:
- main
paths:
- 'operator/**'
- 'crds/**'
- 'manifest-gen/**'
- '.github/workflows/cocl_basic_ci.yaml'
- 'Cargo.toml'
- 'Cargo.lock'
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting
ACTIONS_LINTS_TOOLCHAIN: 1.89.0
jobs:
lint:
name: Lint with pinned toolchain
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run lint checks
run: make lint
build_and_test:
name: ${{ matrix.rust }} / ${{ matrix.profile }}
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
profile:
- dev
- release
target:
- x86_64-unknown-linux-gnu
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo test
continue-on-error: ${{ matrix.rust == 'beta' }}
run: |
if [ "${{ matrix.profile }}" == "release" ]; then
make test-release
else
make test
fi