Skip to content

Commit

Permalink
revamp ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas committed Nov 15, 2021
1 parent 706a88f commit a489d38
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
56 changes: 27 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit a489d38

Please sign in to comment.