name: CI
on:
push:
branches:
- master
pull_request:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install toolchain no-std
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv6m-none-eabi
override: true
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --verbose -- --check
- name: Build no-std
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target thumbv6m-none-eabi --no-default-features
- name: Build no-std serde
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target thumbv6m-none-eabi --no-default-features --features serde-types-minimal
- name: Build no-std alloc
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target thumbv6m-none-eabi --no-default-features --features alloc
- name: Run tests all features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features
- name: Run tests serde
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --features serde-types
- name: Run tests no-std
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features
- name: Run tests no-std alloc
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features alloc
- name: Run tests serde no-std
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features serde-types-minimal
- name: Run tests serde no-std alloc
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features alloc-serde
- name: Run tests serde
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --features serde-types
publish:
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Verify tag version
run: |
cargo install toml-cli
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} Cargo.toml
- name: Publish crate
uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}