From 06d50764d3b97eb575272571f765e289c4919d2e Mon Sep 17 00:00:00 2001 From: rjtch Date: Fri, 2 Feb 2024 20:33:19 +0100 Subject: [PATCH] ci: review ci and linter workflows #3 Signed-off-by: rjtch --- .github/workflows/ci.yml | 44 +++++++++++++++ .github/workflows/{linter.yaml => linter.yml} | 0 .github/workflows/test.yaml | 56 ------------------- 3 files changed, 44 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/ci.yml rename .github/workflows/{linter.yaml => linter.yml} (100%) delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..62e5058 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: ci + +on: + push: + workflow_dispatch: + +permissions: + contents: read + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: "true" + # - uses: jdx/mise-action@v2 + - name: install mise until mise-action is allowed + uses: taiki-e/install-action@v2 + with: + tool: mise, cargo-nextest, cargo-hack + - name: Rust Cache + uses: actions/cache@v4 + continue-on-error: false + with: + path: | + ~/.cargo/bin + ~/.cargo/registry + ~/.cargo/git/db/ + key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.toml') }} # no Cargo.lock in this repo + restore-keys: | + ${{ runner.os }}-sdk-rust- + - run: make generate + - run: make check_no_uncommitted_changes_on_sdk + - run: make check + - run: make test diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yml similarity index 100% rename from .github/workflows/linter.yaml rename to .github/workflows/linter.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 9d7aee5..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: test - -permissions: - contents: read - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - workflow_dispatch: - inputs: - commit_sha: - description: Git commit sha, on which, to run this workflow - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - tests: - name: Run - test_${{ matrix.test_projects }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - test_projects: - - cargo_nextest - - cargo_check - - cargo_machete - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: nightly - - uses: actions/cache@v4 - continue-on-error: false - with: - path: | - ~/.cargo/bin - ~/.cargo/registry - ~/.cargo/git/db/ - key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-sdk-rust- - - uses: taiki-e/install-action@v2 - with: - tool: nextest,cargo-deny, cargo-hack, cargo-machete - - name: Run test ${{ matrix.test_projects }} - run: make -f Makefile test_${{ matrix.test_projects }}