Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,37 @@ jobs:
uses: actions/checkout@v4
- uses: DeterminateSystems/determinate-nix-action@v3
- uses: DeterminateSystems/flakehub-cache-action@main
- run: nix develop -c action-validator -v ./.github/workflows/workflow.yml
- run: nix develop -c prettier --check .

- name: Validate workflow
run: nix develop -c action-validator -v ./.github/workflows/workflow.yml

- name: Get npm cache directory
id: npm-cache-directory
run: |
echo "directory=$(nix develop --command npm config get cache | tr -d '\n')" >> $GITHUB_OUTPUT

- name: Set up npm cache
uses: actions/cache@v5
with:
path: ${{ steps.npm-cache-directory.outputs.directory }}
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-cache

- name: Install npm dependencies
run: nix develop --command npm ci

- name: Lint
run: nix develop --command npm run lint

- name: Build
run: nix develop --command npm run build

- name: Check git status
run: git status --porcelain=v1

- name: Ensure no staged changes
run: git diff --exit-code

DeterminateCI:
uses: ./.github/workflows/workflow.yml
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ on:
required: false
default: true
type: boolean
flake-iter-flakeref:
description: |
Flake reference to use for the flake-iter process. Useful for pinning to specific versions should standards require it. Defaults to the latest release available on FlakeHub.
type: string
required: false
default: https://flakehub.com/f/DeterminateSystems/flake-iter/*
runner-map:
description: |
A custom mapping of [Nix system types](https://zero-to-nix.com/concepts/system-specificity) to desired Actions runners
Expand Down Expand Up @@ -104,10 +98,13 @@ jobs:
id: inventory
env:
FLAKE_ITER_RUNNER_MAP: ${{ toJson(fromJson(inputs.runner-map)) }}
FLAKE_ITER_FLAKEREF: ${{ inputs.flake-iter-flakeref }}
# Necessary to satisfy detsys-ts
INPUT__INTERNAL-STRICT-MODE: "false"
# Use the main branch rather than PR, tag, etc.
INPUT_SOURCE-BRANCH: "main"
working-directory: ${{ inputs.directory }}
run: |
nix run "$FLAKE_ITER_FLAKEREF" -- systems
# NodeJS is always available on the runner
run: node ${{ github.workspace }}/dist/index.cjs
build:
runs-on: ${{ matrix.systems.runner }}
needs: inventory
Expand All @@ -131,9 +128,13 @@ jobs:
- name: Build for ${{ matrix.systems.nix-system }}
env:
FLAKE_ITER_NIX_SYSTEM: ${{ matrix.systems.nix-system }}
FLAKE_ITER_FLAKEREF: ${{ inputs.flake-iter-flakeref }}
# Necessary to satisfy detsys-ts
INPUT__INTERNAL-STRICT-MODE: "false"
# Use the main branch rather than PR, tag, etc.
INPUT_SOURCE-BRANCH: "main"
working-directory: ${{ inputs.directory }}
run: nix run "$FLAKE_ITER_FLAKEREF" -- --verbose build
# NodeJS is always available on the runner
run: node ${{ github.workspace }}/dist/index.cjs

success:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
package-lock.json
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

Loading
Loading