-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 1.73 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
66
67
68
69
70
# SPDX-FileCopyrightText: 2021 - 2023 Robin Vobruba <hoijui.quaero@gmail.com>
#
# SPDX-License-Identifier: Unlicense
name: build
on:
push:
branches: [ master, develop ]
paths:
- 'src/**'
- '**/src/**'
- 'tests/**'
- '**/tests/**'
- 'Cargo.toml'
- '**/Cargo.toml'
- 'Cargo.lock'
- '**/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:
# This makes sure we also get tags,
# so we get the correct version; see bug:
# https://github.com/actions/checkout/issues/701
fetch-depth: 0
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: "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: "Install STOML (BASH TOML parser) *again*, because the cache recreation above might have removed it"
run: scripts/install_stoml
- name: "Build"
run: scripts/build
- name: "Test & Check"
run: scripts/test