Skip to content

Commit

Permalink
devenv: Add Phpactor
Browse files Browse the repository at this point in the history
This contains a LSP for PHP.

Since we do not need it in CI, let’s add another `devShell` that will only be used there.
  • Loading branch information
jtojnar committed Nov 23, 2024
1 parent 8643466 commit a604f99
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,32 @@ jobs:
${{ runner.os }}-composer-
- name: Install dependencies
run: nix-shell --run 'npm run install-dependencies'
run: nix-shell -A ci --run 'npm run install-dependencies'

- name: Check front-end code
if: matrix.lint
run: nix-shell --run 'npm run check:client'
run: nix-shell -A ci --run 'npm run check:client'

- name: Check syntax of back-end code
run: nix-shell --run 'npm run check:server:lint'
run: nix-shell -A ci --run 'npm run check:server:lint'

- name: Lint back-end code
if: matrix.lint
run: nix-shell --run 'npm run check:server:cs'
run: nix-shell -A ci --run 'npm run check:server:cs'

- name: Lint helper code
if: matrix.lint
run: nix-shell --run 'npm run check:helpers:cs'
run: nix-shell -A ci --run 'npm run check:helpers:cs'

- name: Run unit tests
run: nix-shell --run 'npm run test:server'
run: nix-shell -A ci --run 'npm run test:server'

- name: Analyse back-end code
if: matrix.phpstan
run: nix-shell --run 'npm run check:server:phpstan'
run: nix-shell -A ci --run 'npm run check:server:phpstan'

- name: Run integration tests
run: SELFOSS_TEST_STORAGE_BACKEND=${{ matrix.storage }} nix-shell --run 'npm run test:integration'
run: SELFOSS_TEST_STORAGE_BACKEND=${{ matrix.storage }} nix-shell -A ci --run 'npm run test:integration'

deploy:
name: 'Upload artefacts'
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Build a zipball
id: zipball
run: |
nix-shell --run 'npm run dist'
nix-shell -A ci --run 'npm run dist'
echo "file_name=$(echo selfoss-*.zip)" >> "$GITHUB_OUTPUT"
echo "version=$(echo selfoss-*.zip | sed -e 's/^selfoss-//' -e 's/\.zip$//')" >> "$GITHUB_OUTPUT"
Expand Down
17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@
};
};

developmentSupport = {
nativeBuildInputs = [
# PHP LSP
pkgs.phpactor
];
};

qaTools = {
nativeBuildInputs = [
# Back-end code validation.
Expand All @@ -112,6 +119,16 @@
# Expose shell environment for development.
devShells = {
default = pkgs.mkShell (
mergeEnvs [
languageEnv
developmentSupport
qaTools
websiteTools
dbServers.${matrix.storage}
]
);

ci = pkgs.mkShell (
mergeEnvs [
languageEnv
qaTools
Expand Down
5 changes: 4 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ let
self = import flake-compat {
src = ./.;
};

devShells = self.shellNix.outputs.devShells.${builtins.currentSystem};
in
self.shellNix
# Add rest of the devShells for the current system so that we can easily access them with nix-shell.
devShells.default // devShells

0 comments on commit a604f99

Please sign in to comment.