Skip to content

Commit 126ddf5

Browse files
Settings screen update / Fix Drizzle Kit Studio (#1109)
* Makes settings screen responsive * Also optimizes some indexes for fetching data and then also fixes schema to get drizzlekit working * Update e2e tests action * Update all actions node to lts and concurrency check
1 parent 9f0b975 commit 126ddf5

File tree

13 files changed

+2114
-626
lines changed

13 files changed

+2114
-626
lines changed

.github/workflows/alt-text-bot.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Accessibility-alt-text-bot
1+
name: Accessibility Alt Text Bot
2+
23
on:
34
issues:
45
types: [opened, edited]
@@ -11,15 +12,19 @@ on:
1112
discussion_comment:
1213
types: [created, edited]
1314

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number || github.event.discussion.number || github.ref }}
17+
cancel-in-progress: true
18+
1419
permissions:
1520
issues: write
1621
pull-requests: write
1722
discussions: write
1823

1924
jobs:
2025
accessibility_alt_text_bot:
21-
name: Check alt text is set on issue or pull requests
26+
name: Check alt text on issues and pull requests
2227
runs-on: ubuntu-latest
2328
steps:
24-
- name: Get action 'github/accessibility-alt-text-bot'
25-
uses: github/accessibility-alt-text-bot@v1.4.0 # Set to latest
29+
- name: Run Alt Text Bot
30+
uses: github/accessibility-alt-text-bot@v1.4.0

.github/workflows/e2e-tests.yml

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,106 @@ on:
44
push:
55
branches:
66
- develop
7-
pull_request:
7+
pull_request_target:
8+
types: [opened, synchronize, reopened]
89
branches:
910
- develop
1011

12+
# Cancel old builds on new commit for same workflow + branch/PR
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1117
jobs:
18+
initial-checks:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
fetch-depth: 0
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 'lts/*'
31+
cache: 'npm'
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
1236
e2e:
37+
needs: initial-checks
1338
runs-on: ubuntu-latest
39+
environment: production
1440

1541
env:
1642
DATABASE_URL: "postgresql://postgres:secret@localhost:5432/postgres"
1743
NEXTAUTH_URL: http://localhost:3000/api/auth
1844
GITHUB_ID: ${{ secrets.E2E_GITHUB_ID }}
1945
GITHUB_SECRET: ${{ secrets.E2E_GITHUB_SECRET }}
20-
NEXTAUTH_SECRET: "please_keep_this_secret"
46+
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
2147

2248
steps:
2349
- name: Checkout repository
24-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.event.pull_request.head.sha }}
53+
fetch-depth: 0
2554

2655
- name: Setup Node.js
27-
uses: actions/setup-node@v3
56+
uses: actions/setup-node@v4
2857
with:
2958
node-version: 'lts/*'
59+
cache: 'npm'
60+
61+
- name: Cache Playwright browsers
62+
uses: actions/cache@v3
63+
with:
64+
path: ~/.cache/ms-playwright
65+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
66+
restore-keys: |
67+
${{ runner.os }}-playwright-
3068
3169
- name: Run docker-compose
32-
uses: hoverkraft-tech/compose-action@v2.0.1
70+
uses: isbang/compose-action@v1.5.1
3371
with:
3472
compose-file: "./docker-compose.yml"
73+
down-flags: "--volumes"
3574
services: |
3675
db
3776
3877
- name: Wait for DB to be ready
3978
run: |
40-
until nc -z localhost 5432; do
41-
echo "Waiting for database connection..."
42-
sleep 5
43-
done
79+
timeout 60s bash -c 'until nc -z localhost 5432; do echo "Waiting for database connection..."; sleep 2; done'
80+
shell: bash
4481

4582
- name: Install dependencies
46-
run: npm install
83+
run: npm ci
4784

4885
- name: Install Playwright browsers
4986
run: npx playwright install --with-deps
87+
if: steps.playwright-cache.outputs.cache-hit != 'true'
5088

5189
- name: Seed database
5290
run: |
5391
npm run db:push
5492
npm run db:seed
5593
5694
- name: Run Playwright tests
57-
run: npx playwright test --reporter=html
95+
id: playwright-tests
96+
run: npx playwright test
97+
continue-on-error: true
5898

59-
- uses: actions/upload-artifact@v4
60-
if: ${{ !cancelled() }}
99+
- name: Upload Playwright report
100+
uses: actions/upload-artifact@v4
101+
if: always()
61102
with:
62103
name: playwright-report
63104
path: playwright-report/
64-
retention-days: 30
105+
retention-days: 30
106+
107+
- name: Check test results
108+
if: steps.playwright-tests.outcome == 'failure'
109+
run: exit 1

.github/workflows/greetings.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ on:
66
pull_request_target:
77
types: [opened]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
welcome-new-contributor:
1115
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
1219
steps:
1320
- name: 'Greet the contributor'
1421
uses: garg3133/welcome-new-contributors@v1.2
1522
with:
1623
token: ${{ secrets.GITHUB_TOKEN }}
17-
issue-message: 'Hello @contributor_name, thanks for opening your first issue! your contribution is valuable to us. The maintainers will review this issue and provide feedback as soon as possible.'
18-
pr-message: 'Hello @contributor_name, thanks for opening your first Pull Request. The maintainers will review this Pull Request and provide feedback as soon as possible. Keep up the great work!'
24+
issue-message: 'Hello @{{ contributor }}, thanks for opening your first issue! Your contribution is valuable to us. The maintainers will review this issue and provide feedback as soon as possible.'
25+
pr-message: 'Hello @{{ contributor }}, thanks for opening your first Pull Request. The maintainers will review this Pull Request and provide feedback as soon as possible. Keep up the great work!'

.github/workflows/pull-request.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
1-
name: Check the pull request
1+
name: Code Quality Checks
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, edited]
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
8-
check-pull-request:
9-
name: Check code styling and run tests
12+
lint-and-format:
13+
name: Run ESLint and Prettier
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout source code
1317
uses: actions/checkout@v4
14-
- name: Use the correct Node.js version
18+
19+
- name: Use Node.js
1520
uses: actions/setup-node@v4
1621
with:
17-
node-version: "20.17.0"
22+
node-version: 'lts/*'
23+
cache: 'npm'
24+
1825
- name: Install dependencies
1926
run: npm ci
27+
2028
- name: Run ESLint
2129
run: npm run lint
30+
2231
- name: Run Prettier
2332
run: npm run prettier
33+
34+
- name: Check for uncommitted changes
35+
run: |
36+
git diff --exit-code || \
37+
(echo "Detected uncommitted changes after build. See status below:" && \
38+
git diff && \
39+
exit 1)

0 commit comments

Comments
 (0)