Skip to content

Commit 41e19e4

Browse files
rishabhpoddarRishabh
andauthored
adds run tests workflow (#36)
Co-authored-by: Rishabh <rishabh@supertokens.io>
1 parent 1b52a6f commit 41e19e4

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Run tests"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
coreRepoOwnerName:
6+
description: 'supertokens-core repo owner name'
7+
default: supertokens
8+
required: true
9+
coreRepoBranch:
10+
description: 'supertokens-core repos branch name'
11+
default: master
12+
required: true
13+
pluginRepoOwnerName:
14+
description: 'supertokens-plugin-interface repo owner name'
15+
default: supertokens
16+
required: true
17+
pluginInterfaceBranch:
18+
description: 'supertokens-plugin-interface repos branch name'
19+
default: master
20+
required: true
21+
22+
jobs:
23+
test_job:
24+
name: Run tests
25+
runs-on: ubuntu-latest
26+
container: rishabhpoddar/supertokens_core_testing
27+
28+
# Service containers to run with `test_job`
29+
services:
30+
# Label used to access the service container
31+
postgres:
32+
# Docker Hub image
33+
image: postgres:latest
34+
# Provide the password for postgres
35+
env:
36+
POSTGRES_DB: supertokens
37+
POSTGRES_PASSWORD: root
38+
POSTGRES_USER: root
39+
# Set health checks to wait until postgres has started
40+
options: >-
41+
--health-cmd pg_isready
42+
--health-interval 10s
43+
--health-timeout 5s
44+
--health-retries 5
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Adds postgres host to devConfig.yaml
49+
run: "sed -i 's/# postgresql_host:/postgresql_host: postgres/g' ./devConfig.yaml"
50+
- name: Cloning supertokens-root
51+
run: cd ../ && git clone https://github.com/supertokens/supertokens-root.git
52+
- name: Update Java 1
53+
run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
54+
- name: Update Java 2
55+
run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
56+
- name: Modifying modules.txt in supertokens-root
57+
run: cd ../supertokens-root && echo "core,${{ github.event.inputs.coreRepoBranch }},${{ github.event.inputs.coreRepoOwnerName }}\nplugin-interface,${{ github.event.inputs.pluginInterfaceBranch }},${{ github.event.inputs.pluginRepoOwnerName }}\npostgresql-plugin,master" > modules.txt
58+
- name: Contents of modules.txt
59+
run: cat ../supertokens-root/modules.txt
60+
- name: Running loadModules in supertokens-root
61+
run: cd ../supertokens-root && ./loadModules
62+
- name: Copying current supertokens-postgresql-plugin branch into supertokens-root
63+
run: cd ../supertokens-root && rm -rf ./supertokens-postgresql-plugin && cp -r ../supertokens-postgresql-plugin ./
64+
- name: Building and running tests
65+
run: cd ../supertokens-root && ./startTestingEnv

0 commit comments

Comments
 (0)