Skip to content

Commit

Permalink
Add some basic devenv tests
Browse files Browse the repository at this point in the history
devenv v1.0 will add proper testing infrastructure, but for now this is a
noddy solution.
  • Loading branch information
anoadragon453 committed Oct 27, 2023
1 parent 7ee1f78 commit 93a10e6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .ci/scripts/build-all-dev-envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ for project in "$PROJECT_FLAKES_DIR"/*/ ; do
cmd=$(grep "^# ci.test-command:" "$PROJECT_FLAKES_DIR/$project/module.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"
git clone --depth 1 --single-branch -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"
# then run the specified test command.
nix develop --impure ..#"$project" -c bash -c "$cmd"
# Leave the project directory.
cd ..
# Delete the project directory.
Expand Down
1 change: 1 addition & 0 deletions project-flakes/complement/module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ci.project-url: https://github.com/matrix-org/complement
# ci.test-command: go build ./tests/...
{ pkgs, ... }:

{
Expand Down
1 change: 1 addition & 0 deletions project-flakes/element-web/module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ci.project-url: https://github.com/vector-im/element-web
# ci.test-command: yarn install && yarn build
{ pkgs, ... }:

{
Expand Down
1 change: 1 addition & 0 deletions project-flakes/synapse/module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ci.project-url: https://github.com/matrix-org/synapse
# ci.test-command: python -m synapse.app.homeserver --server-name local -c homeserver.yaml --generate-config --report-stats=no
{ pkgs, ... }:

let
Expand Down
1 change: 1 addition & 0 deletions project-flakes/sytest/module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ci.project-url: https://github.com/matrix-org/sytest
# ci.test-command: perl --version
{ pkgs, ... }:

{
Expand Down

0 comments on commit 93a10e6

Please sign in to comment.