From ce3d4ab1414cc1ec174af7c0b4eaaa85db14dea3 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Sun, 13 Apr 2025 23:09:05 -0400 Subject: [PATCH] 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. Co-authored-by: Horu <73709188+HigherOrderLogic@users.noreply.github.com> --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..be2b1f98 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: Check COSMIC Files + +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + CARGO_TERM_COLOR: always + # FIXME: This disables -D warnings because the build fails with it + RUSTFLAGS: "" + SKIP_TESTS: "--skip copy_dir_to_same_location \ + --skip copy_file_to_same_location \ + --skip copy_file_with_extension_to_same_loc \ + --skip copy_file_with_diff_name_to_diff_dir \ + --skip copy_to_diff_dir_doesnt_dupe_files \ + --skip copying_files_multiple_times_to_same_location" + + +jobs: + build: + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + matrix: + name: [Linux, Windows, macOS] + include: + - name: Linux + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + dependencies: sudo apt update && sudo apt -y install libglvnd-dev libwayland-dev libxkbcommon-dev libinput-dev libssl-dev libflatpak-dev + - name: Windows + os: windows-latest + target: x86_64-pc-windows-msvc + dependencies: "" + - name: macOS + os: macos-latest + target: x86_64-apple-darwin + dependencies: brew install libxkbcommon wayland + + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Add Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + + - name: Dependencies + run: ${{ matrix.dependencies }} + + - name: Build ${{ matrix.name }} + run: cargo build --target ${{ matrix.target }} --verbose --locked + - run: cargo test --target ${{ matrix.target }} --verbose -- ${{ env.SKIP_TESTS }} +