commit 5a5b4736c6526c80e27a896b55e75b2d7076eb82 parent a3ffac057b80a53ee9a60c8499fd75e847994b38 Author: minerva-jupiter <ryouturn@gmail.com> Date: Fri, 31 Oct 2025 07:03:05 +0900 Merge branch 'main' of https://github.com/minerva-jupiter/image-light-freq-conv Diffstat:
| A | .github/workflows/release.yml | | | 94 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | .github/workflows/testing.yml | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 139 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - v* + +env: + CARGO_TERM_COLOR: always + +jobs: + Test: + uses: ./.github/workflows/testing.yml + + build: + needs: [Test] + runs-on: ${{ matrix.runner }} + env: + PROJECT_NAME: rust-actions-example + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + extension: "" + runner: ubuntu-latest + cross: true + - target: x86_64-pc-windows-msvc + extension: ".exe" + runner: windows-latest + cross: false + - target: x86_64-apple-darwin + extension: "" + runner: macos-latest + cross: false + - target: aarch64-unknown-linux-gnu + extension: "" + runner: ubuntu-latest + cross: true + - target: aarch64-pc-windows-msvc + extension: ".exe" + runner: windows-latest + cross: false + - target: aarch64-apple-darwin + extension: "" + runner: macos-latest + cross: false + - target: armv7-unknown-linux-gnueabihf + extension: "" + runner: ubuntu-latest + cross: true + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Dependencies on Windows + if: ${{ matrix.runner == 'windows-latest' }} + run: | + choco install make --yes + - name: Install Dependencies on MacOS + if: ${{ matrix.runner == 'macos-latest' }} + run: | + brew install make + + - name: Install cross (if needed) + if: ${{ matrix.cross }} + run: cargo install cross --git https://github.com/cross-rs/cross + + - name: Build Project on cross + if: ${{ matrix.cross }} + run: | + cross build --release --target ${{ matrix.target }} --verbose + - name: Build Project + if: ${{ !matrix.cross }} + run: | + rustup target add ${{ matrix.target }} + cargo build --release --target ${{ matrix.target }} --verbose + + - name: Rename Artifacts + shell: bash + run: | + mv target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}{,-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.extension }}} + + - name: Release Artifacts + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: | + target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.target }}${{ matrix.extension }} diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml @@ -0,0 +1,45 @@ +# This workflow runs Rust tests and checks on push and pull request events +name: Rust Testing + +on: + pull_request: + push: + branches: [ main ] + workflow_dispatch: + workflow_call: + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + needs: ["check"] + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v3 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + - name: Test Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + + check: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + - name: Install Rust fmt + run: rustup component add rustfmt + - name: Install Rust clippy + run: rustup component add clippy + - name: Run rustfmt + run: cargo fmt --all -- --check + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings