-
Notifications
You must be signed in to change notification settings - Fork 89
67 lines (67 loc) · 3.54 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
name: "Run tests"
on:
workflow_dispatch:
inputs:
pluginInterfaceRepoOwnerName:
description: "supertokens-plugin-interface repo owner name"
default: supertokens
required: true
pluginInterfaceBranchName:
description: "supertokens-plugin-interface repos branch name"
default: master
required: true
coreRepoOwnerName:
description: "supertokens-core repo owner name"
default: supertokens
required: true
coreBranchName:
description: "supertokens-core repo branch name"
default: master
required: true
nodeRepoOwnerName:
description: "supertokens-node repo owner name"
default: supertokens
required: true
nodeBranchName:
description: "supertokens-node repo branch name"
default: master
required: true
jobs:
test_job:
name: Run tests
timeout-minutes: 120
runs-on: ubuntu-latest
container:
image: rishabhpoddar/supertokens_website_sdk_testing_node_16
options: "-u 1001"
steps:
- name: Environment variables
run: |
echo "Plugin Interface Owner: ${{ github.event.inputs.pluginInterfaceRepoOwnerName }}"
echo "Plugin Interface Branch: ${{ github.event.inputs.pluginInterfaceBranchName }}"
echo "Core Owner: ${{ github.event.inputs.coreRepoOwnerName }}"
echo "Core Branch: ${{ github.event.inputs.coreBranchName }}"
echo "Node Owner: ${{ github.event.inputs.nodeRepoOwnerName }}"
echo "Node Branch: ${{ github.event.inputs.nodeBranchName }}"
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Replacing Auth0 credentials in .env.js
run: sed -i 's/AUTH0_EMAIL = "[email protected]"/AUTH0_EMAIL = "${{ secrets.AUTH0_EMAIL }}"/g' test/.env.js && sed -i 's/AUTH0_PASSWORD = "ow93jduDSje00asd"/AUTH0_PASSWORD = "${{ secrets.AUTH0_PASSWORD }}"/g' test/.env.js
- name: Make git use https instead of ssh
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
- run: npm run init
- name: Cloning supertokens-root
run: cd ../ && git clone https://github.com/supertokens/supertokens-root.git
- name: Modifying modules.txt in supertokens-root
run: cd ../supertokens-root && echo "core,${{ github.event.inputs.coreBranchName }},${{ github.event.inputs.coreRepoOwnerName }}\nplugin-interface,${{ github.event.inputs.pluginInterfaceBranchName }},${{ github.event.inputs.pluginInterfaceRepoOwnerName }}" > modules.txt
- name: Contents of modules.txt
run: cat ../supertokens-root/modules.txt
- name: Running loadModules in supertokens-root
run: cd ../supertokens-root && ./loadModules
- name: Installing supertokens-node
run: cd test/server/ && npm i -d --force && npm i --force github:${{ github.event.inputs.nodeRepoOwnerName }}/supertokens-node#${{ github.event.inputs.nodeBranchName }}
- name: Setting up supertokens-root test environment
run: cd ../supertokens-root && bash ./utils/setupTestEnv --local
- name: Run tests
run: npm run test