From f8ca61d5d0dca20769498b0b7178a7021cace536 Mon Sep 17 00:00:00 2001 From: Daniel Bauer <4690162+dnlbauer@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:25:38 +0200 Subject: [PATCH] git actions (#5) * add build action * publish job --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c9e870d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Cargo Build and Test +on: + push: + branches: [ "main" ] + pull_request: + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + build_and_test: + name: WHAM Test + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + steps: + - uses: actions/checkout@v3 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: cargo build --verbose + - run: cargo test --verbose + + publish: + name: WHAM Publish + runs-on: ubuntu-latest + needs: [build_and_test] + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + ignore-unpublished-changes: true + dry-run: ${{ github.event_name != 'push' }} +