Skip to content

Commit 05fbee8

Browse files
committed
Updates to test and PR workflows
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent e522bf4 commit 05fbee8

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939

4040
- name: Post comment
4141
if: steps.fc.outputs.comment-id == '' && always()
42+
continue-on-error: true
4243
uses: actions/github-script@v5
4344
with:
4445
script: |
@@ -51,6 +52,7 @@ jobs:
5152
5253
- name: Update comment
5354
if: steps.fc.outputs.comment-id != '' && always()
55+
continue-on-error: true
5456
uses: peter-evans/create-or-update-comment@v1
5557
with:
5658
edit-mode: replace

.github/workflows/test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ jobs:
2121
with:
2222
node-version: 18
2323
- run: npm ci
24-
- run: npm run test
24+
25+
- name: Type checker
26+
run: npm run typings
27+
28+
# This step won't run when coming from a fork
29+
- name: Test suite
30+
run: npm run test
2531
if: contains(env.VITE_SERVER, '.')
2632
env:
2733
VITE_SERVER: ${{ secrets.VITE_SERVER }}

src/api/tests/connection.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,31 @@ const testConfig = new JsonConfig();
1414
export const CONNECTION_TIMEOUT = process.env.VITE_CONNECTION_TIMEOUT ? parseInt(process.env.VITE_CONNECTION_TIMEOUT) : 25000;
1515

1616
const ENV_CREDS = {
17-
host: process.env.VITE_SERVER || `localhost`,
17+
host: process.env.VITE_SERVER,
1818
user: process.env.VITE_DB_USER,
1919
password: process.env.VITE_DB_PASS,
2020
port: parseInt(process.env.VITE_DB_PORT || `22`)
2121
}
2222

23+
if (ENV_CREDS.host === undefined) {
24+
const messages = [
25+
``,
26+
`Please set the environment variables:`,
27+
`\tVITE_SERVER`,
28+
`\tVITE_DB_USER`,
29+
`\tVITE_DB_PASS`,
30+
`\tVITE_DB_PORT`,
31+
``,
32+
`If you're a developer, make a copy of .env.sample,`,
33+
`rename it to .env, and set the values.`,
34+
``,
35+
];
36+
37+
console.log(messages.join(`\n`));
38+
39+
process.exit(1);
40+
}
41+
2342
export async function newConnection() {
2443
const virtualStorage = testStorage;
2544

0 commit comments

Comments
 (0)