Skip to content

Commit

Permalink
ci: adds pre commit gh action - testing (#292)
Browse files Browse the repository at this point in the history
* adds pre commit gh action - testing

* adds pre commit gh action - testing 2

* adds pre commit gh action - testing 3

* adds pre commit gh action - testing 4

* adds pre commit gh action - testing 5

* adds test check workflow
  • Loading branch information
rishabhpoddar authored Apr 23, 2022
1 parent 0e3d0e3 commit c2fbcbf
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/helpers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
16 changes: 16 additions & 0 deletions .github/helpers/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "helpers",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.26.1",
"github-workflow-helpers": "github:supertokens/github-workflow-helpers"
}
}
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit-hook-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Pre commit hook check"

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
pr-title:
name: Pre commit hook check
runs-on: ubuntu-latest
container: rishabhpoddar/supertokens_website_sdk_testing
steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: "16"
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
- run: npm i
- run: ./hooks/pre-commit.sh
24 changes: 24 additions & 0 deletions .github/workflows/tests-pass-check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Check if "Run tests" action succeeded'

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
pr-run-test-action:
name: Check if "Run tests" action succeeded
timeout-minutes: 60
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: node install
run: cd ./.github/helpers && npm i
- name: Calling github API
run: cd ./.github/helpers && GITHUB_TOKEN=${{ github.token }} REPO=${{ github.repository }} RUN_ID=${{ github.run_id }} BRANCH=${{ github.head_ref }} JOB_ID=${{ github.job }} SOURCE_OWNER=${{ github.event.pull_request.head.repo.owner.login }} CURRENT_SHA=${{ github.event.pull_request.head.sha }} node node_modules/github-workflow-helpers/test-pass-check-pr.js

0 comments on commit c2fbcbf

Please sign in to comment.