Streamline the process of JSON/XML parsing via traits. #5
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: build | |
# This should ensure that the workflow won't run on `dev-*` branches, but will | |
# otherwise execute on any other branch and any pull request (including dev | |
# branches). | |
on: | |
push: | |
branches-ignore: | |
- 'dev-*' | |
pull_request: | |
branches: | |
- '*' | |
env: | |
# A fixed version used for testing, so that the builds don't | |
# spontaneously break after a few years. | |
# Make sure to update this from time to time. | |
RUST_VERSION: "1.77.0" | |
jobs: | |
# Check formatting | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }} | |
- name: Rust format check. | |
run: cargo fmt --all -- --check | |
# Run basic code validity check | |
check: | |
needs: fmt | |
name: Check | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }} | |
- name: Rust code validity check. | |
run: cargo check | |
# Run all tests | |
test: | |
needs: check | |
name: Test Suite | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }} | |
- name: Run tests. | |
run: cargo test --all-features | |
# Check code style | |
clippy: | |
needs: check | |
name: Clippy | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- name: Checkout. | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain. | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }} | |
- name: Run clippy. | |
run: cargo clippy |