-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (72 loc) · 1.89 KB
/
check.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
# SPDX-FileCopyrightText: © 2024 Matt Williams <matt@milliams.com>
# SPDX-License-Identifier: MIT
name: Check
on:
push:
pull_request:
workflow_call:
inputs:
ref:
type: string
default: ''
permissions:
contents: read
jobs:
licenses:
name: License REUSE spec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install reuse
run: |
python -m venv ~/venv
~/venv/bin/pip install reuse
- name: Check REUSE spec
run: ~/venv/bin/reuse lint
code-checks:
name: Tests and lints
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: "x86_64-unknown-linux-gnu"
os: "ubuntu-latest"
cross: false
- target: "aarch64-unknown-linux-gnu"
os: "ubuntu-latest"
cross: true
- target: "x86_64-pc-windows-gnu"
os: "ubuntu-latest"
cross: true
- target: "aarch64-apple-darwin"
os: "macOS-latest"
cross: false
- target: "x86_64-apple-darwin"
os: "macOS-latest"
cross: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
targets: ${{ matrix.target }}
components: clippy, rustfmt
- name: Install cross
uses: taiki-e/install-action@cross
if: matrix.cross
- name: Formatting
run: cargo fmt --check
- name: Linting
run: cargo clippy
- name: Build
run: cargo build --target=${{ matrix.target }}
if: ${{ ! matrix.cross }}
- name: Build
run: cross build --target=${{ matrix.target }}
if: matrix.cross