-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (61 loc) · 1.96 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
name: CI
on:
workflow_dispatch:
push:
branches: [ main, ci-tests ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: "Build and Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libdbus-1-dev libusb-dev libhidapi-dev libhidapi-hidraw0 pkg-config libudev-dev libgtk-3-dev
version: 1.0
- name: "Install Rust"
uses: dtolnay/rust-toolchain@stable
- name: "Cache cargo"
uses: Swatinem/rust-cache@v2
- name: Build
working-directory: ./razer_control_gui
run: cargo build --verbose
- name: Run tests
working-directory: ./razer_control_gui
run: cargo test --verbose
install:
# This assumes that the worker will be using systemctl
name: "Install on Github Worker"
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libdbus-1-dev libusb-dev libhidapi-dev libhidapi-hidraw0 pkg-config libudev-dev libgtk-3-dev
version: 1.0
- name: "Install"
working-directory: ./razer_control_gui
# According to this, sudo sould run ok: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#administrative-privileges
run: ./install.sh install
- name: "Check installation"
working-directory: ./razer_control_gui
run: ../ci-helpers/check-installation.sh
build-nix:
name: "Build and check Nix"
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix build
- run: nix flake check
- name: "Check installation"
run: ./ci-helpers/check-installation-nix.sh