-
Notifications
You must be signed in to change notification settings - Fork 79
59 lines (56 loc) · 1.74 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
name: Build and run tests
on:
push:
branches: [ main ]
paths:
- '**.rs'
- '**/Cargo.*'
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { target: i686-unknown-linux-gnu, use-cross: true }
- { target: x86_64-unknown-linux-gnu }
env:
BUILD_CMD: cargo
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use-cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Use cross as build tool
if: matrix.use-cross
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Build
run: $BUILD_CMD build --verbose --target=${{ matrix.target }}
- name: Check jaq-core without default features
if: ( ! matrix.use-cross )
working-directory: jaq-core
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-std without default features
if: ( ! matrix.use-cross )
working-directory: jaq-std
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Check jaq-json without default features
if: ( ! matrix.use-cross )
working-directory: jaq-json
run: $BUILD_CMD check --no-default-features --target=${{ matrix.target }}
- name: Clippy
if: ( ! matrix.use-cross )
run: $BUILD_CMD clippy -- -Dwarnings --target=${{ matrix.target }}
- name: Run tests
run: $BUILD_CMD test --verbose --target=${{ matrix.target }}