From 1db92897f295be8f575907a76e69d6d1b2e6d5a8 Mon Sep 17 00:00:00 2001 From: Xavier Moffett Date: Sat, 19 Jul 2025 02:28:03 -0400 Subject: [PATCH] chore: Update and also use self-hosted CI --- .forgejo/workflows/check.yml | 58 +++++++++++++++++++++++++++++++++ .github/workflows/check.yml | 62 ++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 22 ------------- 3 files changed, 120 insertions(+), 22 deletions(-) create mode 100644 .forgejo/workflows/check.yml create mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..4a0ac20 --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -0,0 +1,58 @@ +name: Build + +on: + workflow_dispatch: + push: + branches: + - master + +env: + CARGO_TERM_COLOR: always + PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin + RUSTFLAGS: -C target-feature=-crt-static + +jobs: + checkfmt: + name: Check format + runs-on: docker + container: + image: alpine + strategy: + matrix: + toolchain: + - nightly + steps: + - name: Install packages + run: apk add --no-cache rustup nodejs git + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install rustup + run: rustup-init -y --default-toolchain none + - name: Install toolchain + run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - name: Check format + run: cargo fmt --check + check: + name: Check release + runs-on: docker + container: + image: alpine + strategy: + matrix: + toolchain: + - stable + steps: + - name: Install packages + run: apk add --no-cache rustup nodejs git build-base pkgconfig + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize rustup + run: rustup-init -y --default-toolchain none + - name: Install toolchain + run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - name: Lint release + run: cargo clippy --release -- -Dwarnings + - name: Build release + run: cargo build --release + - name: Test release + run: cargo test --release diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..55549f1 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,62 @@ +name: Build + +on: + workflow_dispatch: + pull_request: + types: + - opened + - ready_for_review + - synchronize + branches: + - master + +env: + CARGO_TERM_COLOR: always + PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/github/home/.cargo/bin + RUSTFLAGS: -C target-feature=-crt-static + +jobs: + checkfmt: + name: Check format + runs-on: ubuntu + container: + image: alpine + strategy: + matrix: + toolchain: + - nightly + steps: + - name: Install packages + run: apk add --no-cache rustup nodejs git + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install rustup + run: rustup-init -y --default-toolchain none + - name: Install toolchain + run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - name: Check format + run: cargo fmt --check + check: + name: Check release + runs-on: ubuntu + container: + image: alpine + strategy: + matrix: + toolchain: + - stable + steps: + - name: Install packages + run: apk add --no-cache rustup nodejs git build-base pkgconfig + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize rustup + run: rustup-init -y --default-toolchain none + - name: Install toolchain + run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - name: Lint release + run: cargo clippy --release -- -Dwarnings + - name: Build release + run: cargo build --release + - name: Test release + run: cargo test --release diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index d54fa2f..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Rust - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose