Move generation code into lib.rs #349
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: Rust | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: get rust version | |
id: rustc_version | |
run: echo ::set-output name=version::$(rustc --version) | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ steps.rustc_version.version }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}- | |
${{ runner.os }}-cargo- | |
- name: check formatting | |
run: cargo fmt --all -- --check | |
- name: compiler check | |
run: cargo check --tests --examples | |
- name: tests | |
run: cargo test --verbose | |
- name: linter | |
run: cargo clippy -- -D warnings | |
pedantic: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install clippy nightly | |
run: rustup toolchain install nightly --component clippy | |
- name: get rust nightly version | |
id: rust_nightly | |
run: echo ::set-output name=version::$(rustup run nightly rustc --version) | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.rust_nightly.outputs.version }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}- | |
${{ runner.os }}-cargo- | |
- name: run the pedantic linter (warnings only) | |
run: cargo +nightly clippy --color=always --all-targets -- -W clippy::pedantic | |
build: | |
needs: check | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: get rust version | |
id: rustc_version | |
run: echo ::set-output name=version::$(rustc --version) | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ steps.rustc_version.version }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}- | |
${{ runner.os }}-cargo- | |
- run: cargo build --release | |
- run: mv target/release/schema2000{,_${{ runner.os }}} | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: schema2000 | |
path: target/release/schema2000_${{ runner.os }} |