Enable CI for macOS runners #34
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
# Metadata for the actions workflow | ||
name: CI | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "*" ] | ||
# Environment variables that will be set on all runners | ||
env: | ||
DEV_SHELL_LINUX: "nix --store ~/nix_store develop '.#ci'" | ||
DEV_SHELL_MACOS: "nix develop '.#ci'" | ||
CARGO_TERM_COLOR: always # Always colour Cargo's output. | ||
CARGO_INCREMENTAL: 0 # Always run without incremental builds on CI. | ||
CARGO_PROFILE_DEV_DEBUG: 0 # Don't embed debug info even though the build is a dev build. | ||
# Configuration for individual jobs | ||
jobs: | ||
# This job is responsible for running the unit and integration tests on macOS | ||
test: | ||
name: "Test" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest" ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Install Lix | ||
shell: "bash" | ||
run: | | ||
curl -sSf -L https://install.lix.systems/lix | sh -s -- install --no-confirm | ||
- name: Setup Devshell Command (macOS) | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
run: | | ||
Check failure on line 38 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|
||
export DEV_SHELL=${{ DEV_SHELL_MACOS }} | ||
- name: Setup Devshell Command (linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash | ||
run: | | ||
export DEV_SHELL=${{ DEV_SHELL_LINUX }} | ||
- name: Restore Nix Cache | ||
uses: actions/cache@v3 | ||
if: matrix.os != 'macos-latest' | ||
continue-on-error: true | ||
with: | ||
path: | | ||
~/nix_store | ||
key: nix-${{ hashFiles('**/flake.lock') }}-${{ matrix.os }} | ||
- name: Restore Rust Cache | ||
uses: actions/cache@v3 | ||
continue-on-error: true | ||
with: | ||
path: | | ||
target/ | ||
key: rust-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.os }} | ||
- name: Build Lix Dependencies | ||
shell: bash | ||
run: | | ||
$(DEV_SHELL) | ||
- name: Build Tests | ||
shell: bash | ||
run: | | ||
$(DEV_SHELL) --command cargo test --all-targets --no-run | ||
- name: Run Tests | ||
shell: bash | ||
run: | | ||
$(DEV_SHELL) --command cargo test --all-targets -- --nocapture | ||
# This job runs the linter. | ||
# lint: | ||
# name: "Lint" | ||
# runs-on: "ubuntu-latest" | ||
# steps: | ||
# - name: Checkout Code | ||
# uses: actions/checkout@v3 | ||
# - name: Install Lix | ||
# shell: bash | ||
# run: | | ||
# curl -sSf -L https://install.lix.systems/lix | sh -s -- install --no-confirm | ||
# - name: Restore Nix Cache | ||
# uses: actions/cache@v3 | ||
# continue-on-error: true | ||
# with: | ||
# path: | | ||
# ~/nix_store | ||
# key: nix-${{ hashFiles('**/flake.lock') }}-ubuntu-latest | ||
# - name: Restore Rust Cache | ||
# uses: actions/cache@v3 | ||
# continue-on-error: true | ||
# with: | ||
# path: | | ||
# target/ | ||
# key: rust-${{ hashFiles('**/Cargo.lock') }}-ubuntu-latest | ||
# - name: Build Lix Dependencies | ||
# shell: bash | ||
# run: | | ||
# ${{ env.DEV_SHELL_LINUX }} | ||
# - name: Lint Code | ||
# shell: bash | ||
# run: | | ||
# ${{ env.DEV_SHELL_LINUX }} --command cargo clippy --all-targets | ||
# | ||
# # This job checks the code formatting. | ||
# formatting: | ||
# name: "Check Formatting" | ||
# runs-on: "ubuntu-latest" | ||
# steps: | ||
# - name: Checkout Code | ||
# uses: actions/checkout@v3 | ||
# - name: Install Lix | ||
# shell: bash | ||
# run: | | ||
# curl -sSf -L https://install.lix.systems/lix | sh -s -- install --no-confirm | ||
# - name: Restore Nix Cache | ||
# uses: actions/cache@v3 | ||
# continue-on-error: true | ||
# with: | ||
# path: | | ||
# ~/nix_store | ||
# key: nix-${{ hashFiles('**/flake.lock') }}-ubuntu-latest | ||
# - name: Restore Rust Cache | ||
# uses: actions/cache@v3 | ||
# continue-on-error: true | ||
# with: | ||
# path: | | ||
# target/ | ||
# key: rust-${{ hashFiles('**/Cargo.lock') }}-ubuntu-latest | ||
# - name: Build Lix Dependencies | ||
# shell: bash | ||
# run: | | ||
# ${{ env.DEV_SHELL_LINUX }} | ||
# - name: Check Formatting | ||
# shell: bash | ||
# run: | | ||
# ${{ env.DEV_SHELL_LINUX }} --command cargo fmt --all -- --check |