Rust Tests #729
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust Tests | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git Ref (Optional) | |
required: false | |
jobs: | |
# Check rustfmt | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
components: rustfmt | |
- run: sh ./fmt.sh | |
# Check clippy. This doesn't check ARM though. | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
components: clippy | |
- run: sh ./clippy.sh | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly] | |
steps: | |
- uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref == '' | |
- uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref != '' | |
with: | |
ref: ${{ github.event.inputs.git-ref }} | |
- name: Install Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
- name: Run syntax check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --workspace --all-features | |
- name: Tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --all-features --no-fail-fast | |
env: | |
RUST_BACKTRACE: full | |
# publish: | |
# if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' | |
# needs: [tests, clippy, rustfmt] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Use Node.js 16 | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: 16.x | |
# - name: Install node_modules | |
# run: yarn install | |
# - name: Install Toolchain | |
# uses: actions-rs/toolchain@v1 | |
# with: | |
# profile: minimal | |
# toolchain: stable | |
# override: true | |
# - name: install extra cargo modules | |
# run: cargo install semantic-release-rust --version 1.0.0-alpha.8 # TODO: update version when it becomes available | |
# - name: Semantic Release (publish to npm) | |
# run: yarn semantic-release | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |