1
0
mirror of https://github.com/tonarino/innernet.git synced 2024-11-30 09:06:44 +02:00
innernet/.github/workflows/rust.yml
Matěj Laitl 7ade68379f
Run rustfmt on CI (#178)
* Run rustfmt on CI

* Run rustfmt on nightly toolchain, outside test matrix

Rustfmt doesn't need dependencies and should be platform-agnostic anyway.
2022-01-07 17:57:43 +09:00

76 lines
1.6 KiB
YAML

name: Rust
on:
push:
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
branches:
- '*'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Dependencies (if Ubuntu)
env:
ACCEPT_EULA: Y
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-9-dev
if: contains(runner.os, 'Linux')
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
- name: Test (IPv6)
uses: actions-rs/cargo@v1
with:
command: test
args: --features v6-test --verbose
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check