Skip to content

Commit

Permalink
ci: auto run tests for open PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Oct 10, 2023
1 parent 4546e44 commit af596a7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests-auto-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Auto run tests on open PRs"
on:
pull_request:

jobs:
run_test_job:
uses: ./.github/workflows/tests.yml
with:
pluginInterfaceRepoOwnerName: supertokens
pluginInterfaceBranchName: master
coreRepoOwnerName: supertokens
coreBranchName: master
32 changes: 24 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,42 @@ on:
description: "supertokens-core repo branch name"
default: master
required: true
workflow_call:
inputs:
pluginInterfaceRepoOwnerName:
required: true
pluginInterfaceBranchName:
required: true
coreRepoOwnerName:
required: true
coreBranchName:
required: true
jobs:
test_job:
name: Run tests
timeout-minutes: 60
runs-on: ubuntu-latest
container: rishabhpoddar/supertokens_website_sdk_testing
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: "16"
- 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 }}"
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Environment variables
run: |
echo "Plugin Interface Owner: ${{ $PLUGIN_INTERFACE_OWNER }}"
echo "Plugin Interface Branch: ${{ PLUGIN_INTERFACE_BRANCH }}"
echo "Core Owner: ${{ $CORE_OWNER }}"
echo "Core Branch: ${{ CORE_BRANCH }}"
- name: Make git use https instead of ssh
run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: npm i --force
Expand All @@ -48,7 +64,7 @@ jobs:
- 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.coreBranchName }},${{ github.event.inputs.coreRepoOwnerName }}\nplugin-interface,${{ github.event.inputs.pluginInterfaceBranchName }},${{ github.event.inputs.pluginInterfaceRepoOwnerName }}" > modules.txt
run: cd ../supertokens-root && echo "core,${{ CORE_BRANCH }},${{ $CORE_OWNER }}\nplugin-interface,${{ PLUGIN_INTERFACE_BRANCH }},${{ $PLUGIN_INTERFACE_OWNER }}" > modules.txt
- name: Contents of modules.txt
run: cat ../supertokens-root/modules.txt
- name: Running loadModules in supertokens-root
Expand Down

0 comments on commit af596a7

Please sign in to comment.