Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Jan 22, 2024
1 parent 8e4579a commit 5630f38
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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

0 comments on commit 5630f38

Please sign in to comment.