Skip to content

test

test #1

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
strategy:
fail-fast: false
matrix:
host:
- macos-latest
- windows-latest
- ubuntu-latest
name: Lint on ${{ matrix.host }}
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Cargo fmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy
- name: Test
run: cargo test
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
# needs:
# - lint
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Publish
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish --registry crates-io --token $NPM_TOKEN