Skip to content

Test & Build

Test & Build #5

Workflow file for this run

name: Test & Build
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin]
artifact: [otp-linux, otp-macos]
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build project
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
mv target/x86_64-apple-darwin/release/otp otp-macos
else
mv target/x86_64-unknown-linux-gnu/release/otp otp-linux
fi
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.os == 'macos-latest' && 'otp-macos' || 'otp-linux' }}