-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflow to build on PRs, pushes, and manual commits
This should've been here in the first place to make sure contributor's code actually builds.
- Loading branch information
1 parent
7d0786f
commit fc93dca
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
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 |