2022-10-07 09:09:30 +02:00

80 lines
2.1 KiB
YAML

---
name: Continuous Integration
on:
push:
paths-ignore:
- "**/README.md"
- "**/cd.yml"
pull_request:
paths-ignore:
- "**/README.md"
- "**/cd.yml"
env:
CARGO_TERM_COLOR: always
jobs:
continuous-integration:
name: Checks
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- os: macos-latest
os-name: macos
- os: ubuntu-latest
os-name: linux
- os: windows-latest
os-name: windows
binary-postfix: ".exe"
steps:
- name: Install dependencies
if: ${{ matrix.job.os == 'ubuntu-latest' }}
run: |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libudev-dev
- name: Checkout repository
uses: actions/checkout@v3
- name: Update Rust toolchain
run: rustup update stable && rustup default stable
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Test suite
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --workspace
- name: Format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --workspace -- -D warnings
- name: Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features --workspace --examples
- name: Publish dry run
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: espup-${{ matrix.job.os-name }}${{ matrix.job.binary-postfix }}
path: target/release/espup${{ matrix.job.binary-postfix }}