Skip to content

Add github actions

Add github actions #1

Workflow file for this run

name: build
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_MIN_STACK: 16777212
permissions: {}
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
include:
- platform: ubuntu-latest
artifact-path: target/release/bp
artifact-platform-name: linux-x86_64-gnu
env-command: ">> $GITHUB_ENV"
- platform: macos-latest
artifact-path: target/release/bp
artifact-platform-name: macos-x86_64
env-command: ">> $GITHUB_ENV"
- platform: windows-latest
artifact-path: target/release/bp.exe
artifact-platform-name: windows-x86_64
env-command: "| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append"
runs-on: ${{ matrix.platform }}
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Update Rust
run: rustup update
- name: rustfmt
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: |
cargo fmt -- --check
- name: Build
run: |
cargo build --release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bp-${{ matrix.artifact-platform-name }}
path: ${{ matrix.artifact-path }}
if-no-files-found: error