cleanup Rust 2015 syntax #126
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
check: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
subcommand: ['fmt', 'build', 'clippy', 'test'] | |
include: | |
- subcommand: 'clippy' | |
# treat warnings as errors | |
args: '-- -D warnings' | |
- subcommand: 'fmt' | |
args: '--check' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install crate dependencies | |
run: sudo apt-get install -y libxen-dev | |
- run: cargo ${{ matrix.subcommand }} ${{ matrix.args }} | |
publish: | |
needs: [check] | |
runs-on: ubuntu-22.04 | |
# publish on crates.io | |
# only if push on master, and tag is 'v*' | |
# this should be triggered by cargo release, which creates a new tag and pushes to the repo | |
# cargo release --no-dev-version --skip-publish minor | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Install Xen headers and libraries | |
run: sudo apt-get install -y libxen-dev | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Publish | |
shell: bash | |
run: | | |
cargo publish --token ${{ secrets.CRATES_TOKEN }} |