-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (53 loc) · 1.56 KB
/
build.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
# SPDX-FileCopyrightText: 2021-2022 Robin Vobruba <[email protected]>
#
# SPDX-License-Identifier: Unlicense
name: build
on:
push:
branches: [ master, develop ]
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'scripts/build'
- '.github/workflows/build.yml'
release:
types: [ published ]
env:
RUST_BACKTRACE: 1
jobs:
push_to_registry:
name: Compile
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
with:
submodules: true
- name: "Install STOML (BASH TOML parser)"
run: scripts/install_stoml
- name: "Setup Python 3"
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip' # caching pip dependencies
cache-dependency-path: '.github/requirements-ci.txt'
- name: "Install the REUSE tool"
run: pip install reuse
- name: "Install musl-gcc"
# This is required, because we depend on system libraries
# like libz, which need to be compiled for MUSL with musl-gcc,
# which is part of musl-tools.
run: sudo apt install -y musl-tools
- name: "Get the Rust toolchain"
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
components: rustfmt, clippy
- name: "Smart caching for rust/cargo"
uses: Swatinem/rust-cache@v2
- name: "Build"
run: scripts/build
- name: "Test & Check"
run: scripts/test