Skip to content

Commit

Permalink
Rework the CI
Browse files Browse the repository at this point in the history
This reworks the CI to give more control to GitHub Actions.

- The flake exposes the list of smoke-test derivations that GHA load and
  execute.
- The repositories for base (available only for PRs) and head are built
  concurrently
- Built repositories are cached by their commit hash, we should not need
  to build them more than once. We can always delete the specific cache
  in case of issues.

Minor changes:
- haskellPackages -> chapPackages
- Consistent camelCase
- chapPackagesLatestVersion maps to a single version rather than a list
  with a single element

Bump flake
  • Loading branch information
andreabedini committed Oct 30, 2023
1 parent d1f67c2 commit 9d2f4a1
Show file tree
Hide file tree
Showing 6 changed files with 343 additions and 197 deletions.
33 changes: 33 additions & 0 deletions .github/actions/build-repo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build repository
inputs:
ref:
required: true
runs:
using: composite
steps:
- name: Checkout ${{ inputs.ref }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Unpack keys
env:
KEYS: ${{ secrets.KEYS }}
run: |
if [[ -z "$KEYS" ]]; then
echo "Could not access repository secret keys (PR is coming from a fork?)"
echo "Generating fresh keys for this run"
nix develop -c foliage create-keys
else
mkdir _keys
echo "$KEYS" | base64 -d | tar xvz -C _keys
fi
- name: Build repository
run: nix develop --command foliage build -j 0 --write-metadata

- name: Copy static web assets
run: |
cp static/index.html _repo
cp README.md _repo
Loading

0 comments on commit 9d2f4a1

Please sign in to comment.