Skip to content

Commit

Permalink
ci: Run build on macOS runners (M1, Intel) (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella authored Mar 21, 2024
1 parent 90cb77d commit f37a0ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
# INFO: This is only a workaround to avoid timeout issues with the CI;
# whether it becomes a definitive solution or not will require a
# separate discussion with Oscar.
cycle:
- "all-1.7"
- "all-1.6"
- "all-1.5"
- "all-1.4"
- "all-1.3"
- "all-1.2"
- "all-1.1"
- "all-1.0"
os:
- macos-12 # Intel
- macos-14 # M1
- ubuntu-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -39,15 +30,15 @@ jobs:
with:
name: nixpkgs-terraform
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
skipPush: false
skipPush: true
- name: Build packages
run: |
if grep -q authToken ~/.config/cachix/cachix.dhall; then
echo "Cachix token is present"
cachix watch-exec nixpkgs-terraform nix -- build .#\"${{ matrix.cycle }}\" --impure
cachix watch-exec nixpkgs-terraform nix -- flake check --impure
else
echo "Cachix token is not present"
nix build .#\"${{ matrix.cycle }}\" --impure
nix flake check --impure
fi
env:
NIXPKGS_ALLOW_UNFREE: 1
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ nixConfig = {
};
```

Currently, the binary cache supports the following systems:

- aarch64-darwin
- x86_64-darwin
- x86_64-linux

## Usage

After configuring the inputs from the [Install](#install) section, a common use
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
};

checks = config.packages;

packages =
let
versions = import ./lib/packages.nix { inherit pkgs pkgs-unstable; custom-lib = self.lib; };
Expand Down

0 comments on commit f37a0ec

Please sign in to comment.