-
Notifications
You must be signed in to change notification settings - Fork 12
67 lines (63 loc) · 2.4 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# TODO: adjust ci workflow to use new testing setup (vercel and supabase)
name: Node.js CI
env:
CI: "true"
NODE_ENV: "test"
on:
push:
branches: [master, dev, staging]
pull_request:
branches: [master, dev, staging]
# see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions
merge_group:
jobs:
test:
env:
SUPABASE_INTERNAL_IMAGE_REGISTRY: docker.io
SUPABASE_URL: http://localhost:54321
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
SUPABASE_SERVICE_ROLE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
SUPABASE_MAX_ROWS: 10000
ACCESS_CONTROL_ALLOW_ORIGIN: "*"
runs-on: ubuntu-latest
environment: ci_test
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- uses: supabase/setup-cli@v1
with:
version: 1.142.2
- run: supabase start
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm test -- --runInBand --forceExit
- run: supabase stop
release:
name: semantic-release
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: npm ci
- run: npx semantic-release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}