From 573469d1c39076e4356030ac4ce41c197c9f4e73 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sun, 19 Oct 2025 10:37:03 -0700 Subject: [PATCH] ci(github): add build workflow --- .github/dependabot.yml | 21 +++++++++++ .github/workflows/macos.yaml | 70 ++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/macos.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..92e09e76 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "LGUG2Z" + commit-message: + prefix: chore + include: scope + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "LGUG2Z" + commit-message: + prefix: chore + include: scope \ No newline at end of file diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml new file mode 100644 index 00000000..4798c22d --- /dev/null +++ b/.github/workflows/macos.yaml @@ -0,0 +1,70 @@ +# Adapted from https://github.com/rust-lang/rustup/blob/master/.github/workflows/windows-builds-on-master.yaml + +name: macOS + +on: + pull_request: + branches: + - "*" + push: + branches: + - master + - feature/* + - hotfix/* + tags: + - v* + schedule: + - cron: "30 0 * * 0" # Every day at 00:30 UTC + workflow_dispatch: + +jobs: + cargo-deny: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - uses: EmbarkStudios/cargo-deny-action@v2 + + build: + strategy: + fail-fast: true + matrix: + platform: + - os-name: darwin-x86_64 + runs-on: macos-latest + target: x86_64-apple-darwin + - os-name: darwin-aarch64 + runs-on: macos-latest + target: aarch64-apple-darwin + runs-on: ${{ matrix.platform.runs-on }} + permissions: write-all + env: + RUSTFLAGS: -Ctarget-feature=+crt-static -Dwarnings + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - run: rustup toolchain install stable --profile minimal + - run: rustup component add --toolchain stable clippy + - run: rustup toolchain install nightly --allow-downgrade -c rustfmt + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + key: ${{ matrix.platform.target }} + - run: cargo +nightly fmt --check + - run: cargo clippy + - run: cargo test + - uses: houseabsolute/actions-rust-cross@v1 + with: + command: "build" + target: ${{ matrix.platform.target }} + args: "--locked --release" + - uses: actions/upload-artifact@v4 + with: + name: komorebi-${{ matrix.platform.target }}-${{ github.sha }} + path: | + target/${{ matrix.platform.target }}/release/komorebi* + retention-days: 90 \ No newline at end of file