diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 580a084..1fbe623 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,4 +1,4 @@ -name: Audit +name: audit on: schedule: @@ -6,10 +6,16 @@ on: push: jobs: - Audit: - runs-on: windows-latest + audit: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Cache target + id: cache-target + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-audit-target-${{ hashFiles('**/Cargo.toml') }} - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aeddbab..1c07caf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,59 +1,46 @@ -name: Test +name: test on: push: -jobs: - Mac: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Test - uses: actions-rs/cargo@v1 - with: - command: test - args: -- --nocapture +env: + RUSTFLAGS: "--deny=warnings" - Windows: - runs-on: windows-latest +jobs: + test: + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + rust: [stable, nightly] + runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v1 + - name: Cache target + id: cache-target + uses: actions/cache@v1 with: - toolchain: stable - - name: Test - uses: actions-rs/cargo@v1 - with: - command: test - args: -- --nocapture - - Ubuntu: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 + path: target + key: ${{ runner.os }}-${{ matrix.rust }}-test-target-${{ hashFiles('**/Cargo.toml') }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ matrix.rust }} - name: Test uses: actions-rs/cargo@v1 with: command: test args: -- --nocapture - Clippy: + clippy: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v1 + - name: Cache target + id: cache-target + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-clippy-target-${{ hashFiles('**/Cargo.toml') }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -63,11 +50,16 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - Format: + format: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v1 + - name: Cache target + id: cache-target + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-format-target-${{ hashFiles('**/Cargo.toml') }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -78,10 +70,16 @@ jobs: command: fmt args: -- --check - Coverage: + coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Cache target + id: cache-target + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-coverage-target-${{ hashFiles('**/Cargo.toml') }} - uses: actions-rs/toolchain@v1 with: toolchain: nightly @@ -101,4 +99,4 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: /tmp/lcov.info \ No newline at end of file + path-to-lcov: /tmp/lcov.info