-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (98 loc) · 3.3 KB
/
ci.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
on:
push:
branches: [master]
paths-ignore:
- "README.md"
- "PKGBUILD"
- ".vscode/**"
pull_request:
paths-ignore:
- "README.md"
- "PKGBUILD"
- ".vscode/**"
name: CI
env:
KCSHOT_UBUNTU_DEPS: libdbus-1-dev pkg-config libgtk-4-dev libcairo-gobject2 libcairo2-dev meson ninja-build desktop-file-utils
permissions:
contents: read
# Given that this job can get quite expensive at times, we ensure that for a given PR/branch,
# we cancel previous jobs on new pushes.
# See:
# - this Stackoverflow post: https://stackoverflow.com/a/72408109
# - GitHub docs on the matter: https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rustfmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@nightly
id: toolchain-install
with:
components: rustfmt
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ steps.toolchain-install.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock')}}
- run: cargo +nightly fmt --all -- --check
build:
runs-on: ubuntu-22.04
steps:
- run: |
sudo apt-get update -y
sudo apt install -y $KCSHOT_UBUNTU_DEPS
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
id: toolchain-install
with:
components: clippy
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
subprojects/blueprint-compiler/
builddir/
key: ${{ runner.os }}-${{ steps.toolchain-install.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock')}}-${{ hashFiles('subprojects/blueprint-compiler.wrap') }}-lint
- name: Configure meson
run: meson setup builddir
- name: check
run: KCSHOT_LINTING=1 meson devenv -C builddir cargo clippy --manifest-path=../Cargo.toml -- -D warnings
test:
if: false
runs-on: ubuntu-22.04
steps:
- run: |
sudo apt-get update -y
sudo apt install -y $KCSHOT_UBUNTU_DEPS
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
id: toolchain-install
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
subprojects/blueprint-compiler/
builddir/
key: ${{ runner.os }}-${{ steps.toolchain-install.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock')}}-${{ hashFiles('subprojects/blueprint-compiler.wrap') }}-test
- name: Configure meson
run: meson setup builddir
- name: test
run: meson test --verbose -C builddir