Skip to content

Run tests

Run tests #230

Workflow file for this run

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