Skip to content

Commit

Permalink
Add CI workflow to build on PRs, pushes, and manual commits
Browse files Browse the repository at this point in the history
This should've been here in the first place to make sure contributor's code actually builds.
  • Loading branch information
ImperatorStorm committed May 14, 2022
1 parent 7d0786f commit fc93dca
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1

- name: Install Rust for macOS Intel
if: matrix.os == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
- name: Install Rust for macOS
if: matrix.os == 'macos-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
- name: Install Rust for Windows
if: matrix.os == 'windows-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust for Linux
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu

- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install librust-gdk-dev gcc-mingw-w64-x86-64
- name: Lint code
run: just lint

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test

- name: Build macOS
if: matrix.os == 'macos-latest'
run: |
just build-mac-intel
just build-mac-arm
- name: Build Windows MSVC
if: matrix.os == 'windows-latest'
run: just build-win
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: |
just build-linux
just build-windows-glibc
- name: Build Linux NoGUI
if: matrix.os == 'ubuntu-latest'
run: just build-linux-nogui

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: out/ferium*.zip
if-no-files-found: error

0 comments on commit fc93dca

Please sign in to comment.