Skip to content

Commit

Permalink
Run CI on macOS as well
Browse files Browse the repository at this point in the history
  • Loading branch information
doshitan committed Dec 27, 2024
1 parent 98c85aa commit 0f881ee
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 65 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci-nix-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Template for CI (nix)

on:
workflow_call:
inputs:
os:
required: true
type: string

jobs:
# we do this first and make other jobs dependent on this mainly for
# compute-time efficiency, as the other jobs will re-use built artifacts
# pushed to the cache, no need for a bunch of jobs to build the same stuff in
# parallel when a new dependency is added for example
build:
name: Build
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run build
run: nix build

lint:
name: Lint
runs-on: ${{ inputs.os }}
needs: build

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main

- name: Run lint
run: nix develop --command bash -c "make check-static"

test:
name: Test
runs-on: ${{ inputs.os }}
needs: build

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-git
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run tests
run: nix develop --command bash -c "make test"

install:
name: Install
runs-on: ${{ inputs.os }}
needs: build

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run install
run: nix profile install --accept-flake-config '.'

- name: Run --help
run: nava-platform --help

- name: Run e2e
run: make test-e2e
73 changes: 11 additions & 62 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,14 @@ on:
workflow_dispatch:

jobs:
# we do this first and make other jobs dependent on this mainly for
# compute-time efficiency, as the other jobs will re-use built artifacts
# pushed to the cache, no need for a bunch of jobs to build the same stuff in
# parallel when a new dependency is added for example
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run build
run: nix build

lint:
name: Lint
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main

- name: Run lint
run: nix develop --command bash -c "make check-static"

test:
name: Test
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/configure-git
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run tests
run: nix develop --command bash -c "make test"

install:
name: Install
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run install
run: nix profile install --accept-flake-config '.'

- name: Run --help
run: nava-platform --help

- name: Run e2e
run: make test-e2e
ci:
strategy:
fail-fast: false
matrix:
# macos is currently broken due to:
# https://github.com/copier-org/copier/issues/1595
os: [ubuntu-latest]

uses: ./.github/workflows/ci-nix-template.yml
with:
os: ${{ matrix.os }}
9 changes: 6 additions & 3 deletions .github/workflows/ci-pipx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ on:
python-version:
required: true
type: string
os:
required: true
type: string

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +31,7 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -47,7 +50,7 @@ jobs:

install:
name: Install
runs-on: ubuntu-latest
runs-on: ${{ inputs.os }}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest]

uses: ./.github/workflows/ci-pipx.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}

0 comments on commit 0f881ee

Please sign in to comment.