diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2d9a162..bfd1807 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -9,7 +9,7 @@ env: jobs: publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -19,7 +19,7 @@ jobs: target: wasm32-unknown-unknown - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - uses: actions-rs/cargo@v1 with: command: generate-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dc3fe9..6e5e745 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,64 +11,62 @@ env: CARGO_TERM_COLOR: always jobs: - check: - runs-on: ubuntu-20.04 + check-and-build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + toolchain: [stable, beta, nightly] steps: - uses: actions/checkout@v2 + # set up environment + - uses: actions/setup-node@v1 + with: + node-version: 16 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: ${{ matrix.toolchain }} override: true target: wasm32-unknown-unknown components: rustfmt, clippy + # cargo - uses: actions-rs/cargo@v1 with: command: generate-lockfile - uses: actions/cache@v2 with: path: | + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin target - key: ${{ runner.os }}-lint-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/cargo@v1 with: command: check + if: matrix.os != 'windows-latest' + - uses: actions-rs/cargo@v1 with: command: fmt + if: matrix.os != 'windows-latest' + - uses: actions-rs/cargo@v1 with: command: clippy + if: matrix.os != 'windows-latest' - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - target: wasm32-unknown-unknown - - uses: actions/setup-node@v1 - with: - node-version: 14 - - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.cargo/bin - target - key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - - name: Install wasm dep - run: cargo install wasm-bindgen-cli || true - name: Run openssl tests run: cargo test + if: matrix.os != 'windows-latest' - name: Run pure rust tests run: cargo test --no-default-features --features pure + - name: Install wasm dep + run: cargo install wasm-bindgen-cli || true - name: Run wasm tests run: cargo test --no-default-features --features pure --target=wasm32-unknown-unknown + - name: Check cargo package run: cargo publish --dry-run + if: matrix.os != 'windows-latest'