Skip to content
Draft
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
12 changes: 10 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
use nix
watch_file flake.nix flake.lock
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

watch_file flake.nix
watch_file flake.lock
if ! use flake . --no-pure-eval
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
18 changes: 11 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,37 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@v25

- uses: cachix/cachix-action@v14
with:
name: devenv

- name: Set outputs
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Install dependencies
run: nix-shell --run 'composer install --no-interaction'
run: nix develop --no-pure-eval -c composer install --no-interaction

- name: Check code using Nette code checker
run: nix-shell --run 'code-checker -d app'
run: nix develop --no-pure-eval -c code-checker -d app

- name: Lint coding style
run: nix-shell --run 'composer run-script cs'
run: nix develop --no-pure-eval -c composer run-script cs

- name: Run static analysis
run: nix-shell --run 'composer run-script phpstan'
run: nix develop --no-pure-eval -c composer run-script phpstan

- name: Lint source code
run: nix-shell --run 'composer run-script lint'
run: nix develop --no-pure-eval -c composer run-script lint

- name: Run tests
run: |
cp .github/workflows/private.neon app/Config/private.neon
nix-shell --run 'composer test'
nix develop --no-pure-eval -c composer test

- name: Build a zipball
run: nix-shell --run 'npm run dist "entries-${{ steps.vars.outputs.sha_short }}.zip"'
run: nix develop --no-pure-eval -c npm run dist "entries-${{ steps.vars.outputs.sha_short }}.zip"

- name: Upload the zipball to GitHub
uses: actions/upload-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/private.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
dbal:
driver: mysqli
unix_socket: %env.DEVENV_RUNTIME%/mysql.sock

parameters:
adminPassword: heslo
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ phpstan.neon
/.parcel-cache/

/.direnv/
/.devenv/
3 changes: 3 additions & 0 deletions app/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public static function boot(): Configurator {
$configurator->enableTracy(__DIR__ . '/../log');
$configurator->setTimeZone('UTC');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->addDynamicParameters([
'env' => getenv(),
]);
$configurator
->addConfig(__DIR__ . '/Config/common.neon');
$configurator
Expand Down
14 changes: 0 additions & 14 deletions default.nix

This file was deleted.

243 changes: 215 additions & 28 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading