-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.64 KB
/
main.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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
build_and_test:
name: Test and Build - ${{ matrix.version }}
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.event.commits[0].message, 'chore(release):') }}
strategy:
fail-fast: false
matrix:
version:
- 1.61.0
- stable
- nightly
services:
fluentd:
image: fluentd
ports:
- 24224:24224
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.version }}
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}
target: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sccache
- uses: mozilla-actions/[email protected]
- run: |
echo "SCCACHE_GHA_ENABLED=true" >>$GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >>$GITHUB_ENV
- run: cargo test --workspace --no-fail-fast -- --nocapture
env:
RUST_BACKTRACE: "1"
RUST_LOG: "debug"
- run: cargo build --workspace --verbose
lint:
name: Lint
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.event.commits[0].message, 'chore(release):') }}
steps:
- uses: actions/checkout@v4
- name: Install toolchain and components
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
components: rustfmt, clippy
- run: cargo fmt -- --color=always --check
- run: cargo check --tests --workspace --verbose
- run: cargo clippy --workspace --verbose