-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide development environment via
nix
(#2274)
I am only keeping the meaningful commit messages: * Add bash completion in development shells It turns out that nix shells have a nice way to load completions already. This even uses "bash" in the installation, so that it does not interfere with other shells that may load the nix environment with direnv. https://www.github.com/NixOS/nixpkgs/pull/103501 https://www.github.com/scop/bash-completion/blob/7f1165018a72f837d59b3cea7071efa0108841a2/README.md Since I now used the "lazy" approach for loading the completions, the completion on `python manage.py <Tab>` does not work anymore, because the builtin completions are found first. We could overwrite BASH_COMPLETION_USER_DIR to have the highest precedence, but I think that most users use `./manage.py` anyways (it is what we recommend in our README) and the current approach seems to be the most canonical way to do this within nix packages. * Use unix domain sockets instead of TCP for postgres and redis * Don't use `projectDir` This should avoid that editing some views.py file changes the hash of the poetry environment and thus save on some rebuilds. (The rebuilds would only create some symlinks, all actually expensive steps are cached, but this change won't hurt). * Remove `poetry` from packages While `poetry2nix` adds an overlay on the Python package set that disables running the tests, this was not true for the additional poetry from nixpkgs directly. With the override, this poetry had to be rebuilt and thus the tests ran again. * Add gettext to npm-ci pc process too This should fix msgfmt errors for `./manage.py compilemessages`.
- Loading branch information
1 parent
bfd3d4b
commit 38ce586
Showing
25 changed files
with
1,853 additions
and
487 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
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,39 @@ | ||
name: "Setup EvaP Testing Environment" | ||
description: "Sets up the nix environment with caching and copy localsettings" | ||
|
||
inputs: | ||
shell: | ||
description: "name of development shell to use" | ||
required: false | ||
default: .#evap-dev | ||
start-db: | ||
description: "whether or not to run the database in the background" | ||
required: false | ||
default: false | ||
npm-ci: | ||
description: "whether or not to run `npm ci`" | ||
required: false | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: nicknovitski/nix-develop@v1 | ||
with: | ||
arguments: "${{ inputs.shell }}" | ||
|
||
- name: Add localsettings | ||
run: cp evap/settings_test.py evap/localsettings.py | ||
shell: bash | ||
|
||
- name: Install Node dependencies | ||
run: npm ci | ||
shell: bash | ||
if: ${{ inputs.npm-ci }} | ||
|
||
- name: Start database | ||
run: nix run .#services -- --detached && nix run .#wait-for-pc | ||
shell: bash | ||
if: ${{ inputs.start-db }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.