Merged Pull Request #36 from lino-levan/docs-add-macos-build #318
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
name: Rust | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
SHELL: /bin/bash | |
CARGO_TERM_COLOR: never | |
SCCACHE_GHA_ENABLED: "true" | |
CCACHE: sccache | |
jobs: | |
Build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-13] | |
rust: [stable, beta] | |
include: | |
- os: windows-latest | |
id: windows | |
- os: macos-13 | |
id: macos | |
- os: ubuntu-latest | |
id: linux | |
env: | |
SCCACHE_CACHE_SIZE: 3G | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup | |
with: | |
os: ${{ matrix.id }} | |
cache-id: ${{ matrix.id }} | |
- name: Build Windows | |
if: matrix.id == 'windows' | |
env: | |
MOZTOOLS_PATH: ${{ github.workspace }}\\target\\dependencies\\moztools-4.0 | |
CC: clang-cl | |
CXX: clang-cl | |
AR: llvm-lib | |
LINKER: lld-link | |
run: | | |
just build-release -v | |
just test-release -v | |
Rename-Item -Path .\target\release\cli.exe -NewName spiderfire.exe | |
- name: Build POSIX | |
if: matrix.id == 'macos' || matrix.id == 'linux' | |
env: | |
CC: clang | |
CXX: clang++ | |
RUSTC_WRAPPER: sccache | |
run: | | |
just build-release -v | |
just test-release -v | |
mv ./target/release/cli ./target/release/spiderfire | |
strip ./target/release/spiderfire | |
- name: Upload Executables as Artifacts | |
uses: actions/upload-artifact@v3 | |
if: matrix.rust == 'stable' | |
with: | |
name: spiderfire-${{ github.sha }}-${{ matrix.id }} | |
path: target/release/spiderfire${{ matrix.id == 'windows' && '.exe' || '' }} | |
if-no-files-found: error | |
Lint: | |
runs-on: ubuntu-latest | |
env: | |
SCCACHE_CACHE_SIZE: 1G | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Dependencies | |
uses: ./.github/actions/setup | |
with: | |
os: ${{ matrix.id }} | |
cache-id: lint | |
- name: Lint | |
env: | |
CC: clang | |
CXX: clang++ | |
RUSTC_WRAPPER: sccache | |
run: just lint |