Skip to content

Json output upgrades #38

Json output upgrades

Json output upgrades #38

Workflow file for this run

on: [push, pull_request]
name: Continuous integration
jobs:
build:
name: Test ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04, use-cross: true }
- { target: aarch64-apple-darwin, os: macos-14 }
env:
BUILD_CMD: cargo
SUBCOMMAND: test
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/[email protected]
with:
targets: ${{ matrix.job.target }}
- name: Install cross
if: matrix.job.use-cross
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Overwrite build command env variable
if: matrix.job.use-cross
shell: bash
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Overwrite build subcommand env variable
if: matrix.job.build-only
shell: bash
run: echo "SUBCOMMAND=build" >> $GITHUB_ENV
- name: Test
shell: bash
run: $BUILD_CMD $SUBCOMMAND --target ${{ matrix.job.target }}
test_mime_db:
name: Test with MIME database
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
# This runs tests that rely on the MIME database being present.
- run: cargo test -- --ignored
test_linux_latest_stable:
name: Test Linux (latest stable Rust)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo +stable test
regression_test:
name: Output Regression Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
- name: Generate output for all sample files
run: ./sample_files/compare_all.sh
- name: Verify output is unchanged
run: diff -C2 sample_files/compare.result sample_files/compare.expected
package:
name: Check Linux Packaging
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
- run: cargo package --allow-dirty
fmt:
name: Rustfmt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
- run: cargo fmt --all -- --check
actionlint:
name: Actionlint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: raven-actions/actionlint@v1
with:
shellcheck: false