-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to build project flakes
Build all known project flakes on each push/PR.
- Loading branch information
1 parent
d6494b2
commit 819aa1a
Showing
7 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env sh | ||
PROJECT_FLAKES_DIR="project-flakes" | ||
|
||
# Print lines of this script as they're executed, and exit on any failure. | ||
set -ex | ||
|
||
# Loop through each sub-directory in 'project-flakes' | ||
for project in "$PROJECT_FLAKES_DIR"/*/ ; do | ||
# Remove the trailing '/' | ||
project=${project%*/} | ||
# Extract the project name | ||
project=${project##*/} | ||
# Echo the project name for logging | ||
echo "Running nix develop on project: $project" | ||
# Extract the git URL of the project. We often need the files of the | ||
# project locally in order to build the development shell: | ||
url=$(grep "^# ci.project-url:" "$PROJECT_FLAKES_DIR/$project/default.nix" | awk -F': ' '{print $2}') | ||
echo "Cloning repo: $url" | ||
# Clone the project to a directory with the same name. | ||
git clone --depth 1 -q "$url" "$project" | ||
# Enter the project directory. | ||
cd "$project" | ||
# Show the generated outputs of the flake. | ||
nix flake show .. | ||
# Attempt to build and enter the development environment, | ||
# then immediately exit the built shell. | ||
nix develop --impure ..#"$project" -c "true" | ||
# Leave the project directory. | ||
cd .. | ||
# Delete the project directory. | ||
rm -rf "$project" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: "Build project flakes" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: DeterminateSystems/nix-installer-action@bc7b19257469c8029b46f45ac99ecc11156c8b2d # v6 | ||
- uses: DeterminateSystems/magic-nix-cache-action@8a218f9e264e9c3803c9a1ee1c30d8e4ab55be63 # v2 | ||
- run: .ci/scripts/build-all-dev-envs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# ci.project-url: https://github.com/matrix-org/complement | ||
{ pkgs, ... }: | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# ci.project-url: https://github.com/vector-im/element-web | ||
{ pkgs, ... }: | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# ci.project-url: https://github.com/matrix-org/synapse | ||
{ pkgs, ... }: | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# ci.project-url: https://github.com/matrix-org/sytest | ||
{ pkgs, ... }: | ||
|
||
{ | ||
|