feat: export output to JSON #173
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: ["main"] | |
tags: | |
- "v*" | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
linux-build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
# run cargo test in a single thread to fix a race condition in linux | |
run: cargo test --all-features --verbose -- --test-threads=1 | |
mac-build-test: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --all-features --verbose | |
windows-build-test: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --all-features --verbose | |
create-release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
changelog: CHANGELOG.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-assets: | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
needs: create-release | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
bin: mpm | |
target: ${{ matrix.target }} | |
tar: unix | |
zip: windows | |
token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |