Skip to content

Commit

Permalink
Merge branch 'main' into colemickens/expose-runs-on
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc authored Dec 6, 2024
2 parents 5b7f3a0 + f120d88 commit a4cb1c6
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
Please format all files before committing:
nix run nixpkgs#nodePackages.prettier -- --write .
-->
29 changes: 29 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches: main
pull_request:
workflow_dispatch:

jobs:
lints:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: git checkout
uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix run nixpkgs#action-validator -- -v ./.github/workflows/workflow.yml
- run: nix run nixpkgs#nodePackages.prettier -- --check .

DeterminateCI:
uses: ./.github/workflows/workflow.yml
permissions:
id-token: "write"
contents: "read"
with:
directory: ./tests/smoke
23 changes: 21 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
required: false
default: false
type: boolean
directory:
required: false
default: "."
type: string
runner-map:
required: false
type: string
Expand Down Expand Up @@ -43,15 +47,21 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: Determinatesystems/flake-checker-action@main
# disabled pending strategy discussion on exposing tunables
# - uses: Determinatesystems/flake-checker-action@main
- uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: webfactory/[email protected]
if: ${{ inputs.enable-ssh-agent }}
with:
ssh-private-key: ${{ secrets.ssh-private-key }}
- name: Inventory the flake for targeted systems
id: inventory
env:
FLAKE_ITER_RUNNER_MAP: ${{ toJson(fromJson(inputs.runner-map)) }}
working-directory: ${{ inputs.directory }}
run: |
nix run "https://flakehub.com/f/DeterminateSystems/flake-iter/*" -- systems
build:
Expand All @@ -78,17 +88,25 @@ jobs:
- name: Build for ${{ matrix.systems.nix-system }}
env:
FLAKE_ITER_NIX_SYSTEM: ${{ matrix.systems.nix-system }}
working-directory: ${{ inputs.directory }}
run: nix run 'https://flakehub.com/f/DeterminateSystems/flake-iter/*' -- --verbose build

success:
runs-on: ubuntu-latest
needs: build
if: ${{ always() }}
permissions:
id-token: "write"
contents: "read"

steps:
- run: true
- run: "true"
- run: |
echo "A dependent in the build matrix failed."
exit 1
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
- uses: actions/checkout@main
if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
- uses: DeterminateSystems/nix-installer-action@main
Expand All @@ -103,3 +121,4 @@ jobs:
rolling: ${{ github.ref == format('refs/heads/{0}', inputs.default-branch) }}
visibility: ${{ inputs.visibility }}
include-output-paths: true
directory: ${{ inputs.directory }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
push:
branches:
- main
- master
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"

Expand Down Expand Up @@ -54,6 +55,7 @@ on:
push:
branches:
- main
- master
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"

Expand Down
25 changes: 25 additions & 0 deletions tests/smoke/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tests/smoke/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.tar.gz";
};

outputs = { self, nixpkgs }: {
devShells.x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux; mkShell {
name = "devshell";
buildInputs = [
hello
];
};

packages.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.hello;
};
}

0 comments on commit a4cb1c6

Please sign in to comment.