diff --git a/.github/workflows/MinedMap.yml b/.github/workflows/MinedMap.yml index ff6b4a5..3f561d0 100644 --- a/.github/workflows/MinedMap.yml +++ b/.github/workflows/MinedMap.yml @@ -1,9 +1,12 @@ name: 'MinedMap' on: ['push', 'pull_request', 'workflow_dispatch'] +env: + RUSTFLAGS: -Dwarnings + RUSTDOCFLAGS: -Dwarnings + jobs: viewer: - name: 'Package viewer' runs-on: 'ubuntu-20.04' steps: @@ -28,3 +31,56 @@ jobs: with: name: 'MinedMap-${{ steps.tag.outputs.tag }}-viewer' path: 'build/pkg' + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt + - run: cargo fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy + - uses: swatinem/rust-cache@v2 + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --workspace --tests --examples + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rust-docs + - uses: swatinem/rust-cache@v2 + - run: cargo doc --workspace --no-deps --document-private-items + + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + rust: [stable] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - uses: swatinem/rust-cache@v2 + - run: cargo test --workspace + - run: cargo test --workspace --no-default-features + - run: cargo test --workspace --examples --bins + - run: cargo test --workspace --no-default-features --examples --bins diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9ee03af..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,81 +0,0 @@ -# A lot of this has been copied from https://github.com/axodotdev/cargo-dist/blob/main/.github/workflows/ci.yml - -name: MinedMap Rust CI - -on: - pull_request: - push: - -env: - RUSTFLAGS: -Dwarnings - RUSTDOCFLAGS: -Dwarnings - -jobs: - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - # Use beta for now for let-else formatting - toolchain: beta - components: rustfmt - - run: cargo fmt --all -- --check - - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: clippy - - uses: swatinem/rust-cache@v2 - - uses: actions-rs/clippy-check@v1 - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --tests --examples - - docs: - runs-on: ubuntu-latest - env: - RUSTDOCFLAGS: -Dwarnings - steps: - - uses: actions/checkout@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: rust-docs - - uses: swatinem/rust-cache@v2 - - run: cargo doc --workspace --no-deps --document-private-items - - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - rust: [stable] - steps: - - uses: actions/checkout@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - uses: swatinem/rust-cache@v2 - # Run the tests/doctests (default features) - - run: cargo test --workspace - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - # Run the tests/doctests (no default features) - - run: cargo test --workspace --no-default-features - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - # Test the examples (default features) - - run: cargo test --workspace --examples --bins - env: - PWD: ${{ env.GITHUB_WORKSPACE }} - # Test the examples (no default features) - - run: cargo test --workspace --no-default-features --examples --bins - env: - PWD: ${{ env.GITHUB_WORKSPACE }}