chore: Bump Rust edition to 2021 #75
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
ci: | |
strategy: | |
matrix: | |
target: | |
- i686-unknown-linux-gnu | |
- i686-unknown-linux-musl | |
- x86_64-pc-windows-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
include: | |
- target: i686-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: i686-unknown-linux-musl | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-gnu | |
os: windows-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup OS packages (Linux) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential gcc-multilib | |
- name: Setup Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Build program | |
run: cargo build --verbose --release --target=${{ matrix.target }} | |
- name: Run tests | |
run: | | |
cargo build --tests --target=${{ matrix.target }} | |
cargo test --verbose --target=${{ matrix.target }} | |
env: | |
RUST_BACKTRACE: 1 | |
- name: Strip debug info from release binary (Linux, mac) | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
run: strip target/${{ matrix.target }}/release/pmv | |
- name: Upload built artifact (Linux, mac) | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pmv-${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/pmv | |
- name: Upload built artifact (Windows) | |
if: startsWith(matrix.os, 'windows') | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pmv-${{ matrix.target }} | |
path: target\${{ matrix.target }}\release\pmv.exe |