Skip to content

Commit a604f99

Browse files
committed
devenv: Add Phpactor
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.
1 parent 8643466 commit a604f99

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

.github/workflows/main.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,32 @@ jobs:
7474
${{ runner.os }}-composer-
7575
7676
- name: Install dependencies
77-
run: nix-shell --run 'npm run install-dependencies'
77+
run: nix-shell -A ci --run 'npm run install-dependencies'
7878

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

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

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

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

9494
- name: Run unit tests
95-
run: nix-shell --run 'npm run test:server'
95+
run: nix-shell -A ci --run 'npm run test:server'
9696

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

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

104104
deploy:
105105
name: 'Upload artefacts'
@@ -141,7 +141,7 @@ jobs:
141141
- name: Build a zipball
142142
id: zipball
143143
run: |
144-
nix-shell --run 'npm run dist'
144+
nix-shell -A ci --run 'npm run dist'
145145
echo "file_name=$(echo selfoss-*.zip)" >> "$GITHUB_OUTPUT"
146146
echo "version=$(echo selfoss-*.zip | sed -e 's/^selfoss-//' -e 's/\.zip$//')" >> "$GITHUB_OUTPUT"
147147

flake.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@
8888
};
8989
};
9090

91+
developmentSupport = {
92+
nativeBuildInputs = [
93+
# PHP LSP
94+
pkgs.phpactor
95+
];
96+
};
97+
9198
qaTools = {
9299
nativeBuildInputs = [
93100
# Back-end code validation.
@@ -112,6 +119,16 @@
112119
# Expose shell environment for development.
113120
devShells = {
114121
default = pkgs.mkShell (
122+
mergeEnvs [
123+
languageEnv
124+
developmentSupport
125+
qaTools
126+
websiteTools
127+
dbServers.${matrix.storage}
128+
]
129+
);
130+
131+
ci = pkgs.mkShell (
115132
mergeEnvs [
116133
languageEnv
117134
qaTools

shell.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ let
77
self = import flake-compat {
88
src = ./.;
99
};
10+
11+
devShells = self.shellNix.outputs.devShells.${builtins.currentSystem};
1012
in
11-
self.shellNix
13+
# Add rest of the devShells for the current system so that we can easily access them with nix-shell.
14+
devShells.default // devShells

0 commit comments

Comments
 (0)