From 3677e309bed5e3712b037faea010ca963c1a87eb Mon Sep 17 00:00:00 2001 From: Shane Madden Date: Tue, 27 Aug 2024 16:57:03 -0600 Subject: [PATCH] sync actions setup with updated/simplified screeps-game-api config --- .github/workflows/build.yml | 42 ----------------- .github/workflows/check.yml | 25 +++++++++++ .github/workflows/lint.yml | 74 ------------------------------ .github/workflows/test.yml | 89 ------------------------------------- README.md | 4 +- 5 files changed, 27 insertions(+), 207 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 03b3502..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,42 +0,0 @@ -on: [push, pull_request] - -name: build - -jobs: - build: - name: build (${{ matrix.toolchain }}) - runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [stable, nightly] - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - id: toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - target: wasm32-unknown-unknown - override: true - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Update Dependencies - uses: actions-rs/cargo@v1 - with: - command: update - - - name: Cache dependencies - env: - rustc-hash: ${{ steps.toolchain.outputs.rustc_hash }} - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ env.rustc-hash }}-${{ hashFiles('**/Cargo.lock') }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..5c6c415 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,25 @@ +on: [push, pull_request] + +name: check + +jobs: + stable: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - run: cargo fmt --all -- --check + - run: cargo clippy --all-features -- -D warnings + - run: cargo test --all-features + nightly: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy, rustfmt + - run: cargo fmt --all -- --check + - run: cargo clippy --all-features -- -D warnings + - run: cargo test --all-features diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 943713b..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,74 +0,0 @@ -on: [push, pull_request] - -name: lint - -jobs: - fmt: - name: fmt (${{ matrix.rust }}) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - nightly - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - components: rustfmt - override: true - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - continue-on-error: false - with: - command: fmt - args: --all -- --check - - clippy: - name: clippy (${{ matrix.rust }}) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - nightly - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - components: clippy - override: true - - - name: Update Dependencies - uses: actions-rs/cargo@v1 - with: - command: update - - - name: Cache dependencies - env: - rustc-hash: ${{ steps.toolchain.outputs.rustc_hash }} - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ env.rustc-hash }}-${{ hashFiles('**/Cargo.lock') }} - - - name: Run cargo clippy - uses: actions-rs/clippy-check@v1 - continue-on-error: false - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features -- -D warnings diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index fbfa82f..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,89 +0,0 @@ -on: [push, pull_request] - -name: test - -jobs: - check: - name: check (${{ matrix.rust }}) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - nightly - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - id: toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - - name: Update Dependencies - uses: actions-rs/cargo@v1 - with: - command: update - - - name: Cache dependencies - env: - rustc-hash: ${{ steps.toolchain.outputs.rustc_hash }} - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ env.rustc-hash }}-${{ hashFiles('**/Cargo.lock') }} - - - name: Run cargo check - uses: actions-rs/cargo@v1 - continue-on-error: false - with: - command: check - - test: - name: test (${{ matrix.rust }}) - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - nightly - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install toolchain - id: toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - - name: Update Dependencies - uses: actions-rs/cargo@v1 - with: - command: update - - - name: Cache dependencies - env: - rustc-hash: ${{ steps.toolchain.outputs.rustc_hash }} - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ env.rustc-hash }}-${{ hashFiles('**/Cargo.lock') }} - - - name: Run cargo test - uses: actions-rs/cargo@v1 - continue-on-error: false - with: - command: test - args: --all-features diff --git a/README.md b/README.md index bb83006..19a8645 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ screeps-game-utils Utility functionality not included in the screeps-game-api crate. -[actions-badge]: https://github.com/rustyscreeps/screeps-game-utils/actions/workflows/build.yml/badge.svg -[actions-builds]: https://github.com/rustyscreeps/screeps-game-utils/actions/workflows/build.yml +[actions-badge]: https://github.com/rustyscreeps/screeps-game-utils/actions/workflows/check.yml/badge.svg +[actions-builds]: https://github.com/rustyscreeps/screeps-game-utils/actions/workflows/check.yml [cratesio-badge]: https://img.shields.io/crates/v/screeps-game-utils.svg [crate]: https://crates.io/crates/screeps-game-utils/ [deps-badge]: https://deps.rs/repo/github/rustyscreeps/screeps-game-utils/status.svg