Skip to content

Commit 6d411ee

Browse files
Rudimentary continuous integration
Related to #921 COSMIC Files is cross platform but patches may inadvertently break non-Linux systems. Usually, these issues are easy to fix. This PR adds a simple CI pipeline so that contributors can use it as a guide to fix build failures.
1 parent 3245f76 commit 6d411ee

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Check COSMIC Files
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
# FIXME: This disables -D warnings because the build fails with it
12+
RUSTFLAGS: ""
13+
SKIP_TESTS: "--skip copy_dir_to_same_location \
14+
--skip copy_file_to_same_location \
15+
--skip copy_file_with_extension_to_same_loc \
16+
--skip copy_file_with_diff_name_to_diff_dir \
17+
--skip copy_to_diff_dir_doesnt_dupe_files \
18+
--skip copying_files_multiple_times_to_same_location"
19+
20+
21+
jobs:
22+
build:
23+
runs-on: ${{ matrix.os }}
24+
continue-on-error: true
25+
strategy:
26+
matrix:
27+
name: [Linux, Windows, macOS]
28+
include:
29+
- name: Linux
30+
os: ubuntu-latest
31+
target: x86_64-unknown-linux-gnu
32+
dependencies: sudo apt update && sudo apt -y install libglvnd-dev libwayland-dev libxkbcommon-dev libinput-dev libssl-dev libflatpak-dev
33+
- name: Windows
34+
os: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
dependencies: ""
37+
- name: macOS
38+
os: macos-latest
39+
target: x86_64-apple-darwin
40+
dependencies: brew install libxkbcommon wayland
41+
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
47+
- name: Add Rust
48+
uses: actions-rust-lang/setup-rust-toolchain@v1
49+
50+
- name: Update ${{ matrix.name }}
51+
run: |
52+
rustup target add ${{ matrix.target }}
53+
rustup update stable
54+
rustup default stable
55+
56+
- name: Dependencies
57+
run: ${{ matrix.dependencies }}
58+
59+
- name: Build ${{ matrix.name }}
60+
run: cargo build --target ${{ matrix.target }} --verbose --locked
61+
- run: cargo test --target ${{ matrix.target }} --verbose -- ${{ env.SKIP_TESTS }}
62+

0 commit comments

Comments
 (0)