Skip to content

Commit

Permalink
Adds run tests workflow (#33)
Browse files Browse the repository at this point in the history
* adds workflow

* fixes script

Co-authored-by: Rishabh <[email protected]>
  • Loading branch information
rishabhpoddar and Rishabh authored Mar 27, 2022
1 parent f41c976 commit 50392e1
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Run tests"
on:
workflow_dispatch:
inputs:
coreRepoOwnerName:
description: 'supertokens-core repo owner name'
default: supertokens
required: true
coreRepoBranch:
description: 'supertokens-core repos branch name'
default: master
required: true
pluginRepoOwnerName:
description: 'supertokens-plugin-interface repo owner name'
default: supertokens
required: true
pluginInterfaceBranch:
description: 'supertokens-plugin-interface repos branch name'
default: master
required: true

jobs:
test_job:
name: Run tests
runs-on: ubuntu-latest
container: rishabhpoddar/supertokens_core_testing

# Service containers to run with `test_job`
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: supertokens
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- uses: actions/checkout@v2
- name: Adds mysql host to devConfig.yaml
run: "sed -i 's/# mysql_host:/mysql_host: mysql/g' ./devConfig.yaml"
- name: Cloning supertokens-root
run: cd ../ && git clone https://github.com/supertokens/supertokens-root.git
- name: Update Java 1
run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
- name: Update Java 2
run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
- name: Modifying modules.txt in supertokens-root
run: cd ../supertokens-root && echo "core,${{ github.event.inputs.coreRepoBranch }},${{ github.event.inputs.coreRepoOwnerName }}\nplugin-interface,${{ github.event.inputs.pluginInterfaceBranch }},${{ github.event.inputs.pluginRepoOwnerName }}\nmysql-plugin,master" > 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: Copying current supertokens-mysql-plugin branch into supertokens-root
run: cd ../supertokens-root && rm -rf ./supertokens-mysql-plugin && cp -r ../supertokens-mysql-plugin ./
- name: Building and running tests
run: cd ../supertokens-root && ./startTestingEnv

0 comments on commit 50392e1

Please sign in to comment.