Skip to content

Commit

Permalink
Merge pull request #11 from DeterminateSystems/graham/fh-421-add-a-te…
Browse files Browse the repository at this point in the history
…st-that-the-determinate-ci-workflow-actually-works

Add a trivial test suite
  • Loading branch information
grahamc authored Oct 28, 2024
2 parents f348ee4 + 4125637 commit 3121b3b
Show file tree
Hide file tree
Showing 5 changed files with 79 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
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
- name: Inventory the flake for targeted systems
id: inventory
env:
FLAKE_ITER_DIRECTORY: ${{ inputs.directory }}
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 @@ -79,8 +79,8 @@ jobs:
ssh-private-key: ${{ secrets.ssh-private-key }}
- name: Build for ${{ matrix.systems.nix-system }}
env:
FLAKE_ITER_DIRECTORY: ${{ inputs.directory }}
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:
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 3121b3b

Please sign in to comment.