-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (110 loc) · 3.37 KB
/
Copy pathbuild.yml
File metadata and controls
134 lines (110 loc) · 3.37 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# SPDX-FileCopyrightText: 2026 ChouChiu
# SPDX-License-Identifier: AGPL-3.0-only
name: Build
on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
jobs:
quality:
name: Check, test, and build
runs-on: ubuntu-latest
timeout-minutes: 45
container:
image: archlinux:latest
steps:
- name: Install system dependencies
run: >-
pacman -Syu --noconfirm --needed
base-devel
git
gtk4
gtk4-layer-shell
webkitgtk-6.0
openssl
rust
dpkg
unzip
- name: Check out repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Cache Bun packages
uses: actions/cache@v6
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Cache Cargo registry and target
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-arch-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-arch-cargo-
- name: Mark workspace as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check React lyrics frontend
run: |
bun install --frozen-lockfile
bun run check
bun run typecheck
bun test
bun run build:lyrics
- name: Verify third-party license data
run: |
cargo install --locked --features cli --version 0.9.1 cargo-about
cargo about generate --locked --all-features data/licenses/about.hbs --output-file data/licenses/dependencies.json
git diff --exit-code -- data/licenses/dependencies.json
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --locked --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --locked --all-targets --all-features
- name: Build release binary
run: cargo build --locked --release
- name: Install cargo-deb and cargo-generate-rpm
run: |
cargo install cargo-deb --locked
cargo install cargo-generate-rpm --locked
- name: Build .deb package
run: cargo deb
- name: Build .rpm package
run: cargo generate-rpm
- name: Upload binary
uses: actions/upload-artifact@v7
with:
name: floatlyrics-linux-x86_64
path: target/release/floatlyrics
if-no-files-found: error
- name: Upload .deb artifact
uses: actions/upload-artifact@v7
with:
name: floatlyrics-deb
path: target/debian/*.deb
if-no-files-found: error
- name: Upload .rpm artifact
uses: actions/upload-artifact@v7
with:
name: floatlyrics-rpm
path: target/generate-rpm/*.rpm
if-no-files-found: error