Skip to content

Commit

Permalink
[E4E-30]: Add Github actions for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCleric committed Nov 21, 2021
1 parent af3d09c commit 7a84926
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/pr-branch-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Apply label "staging"
staging:
base: "staging"

# Apply label "dev"
dev:
base: "development"

# Apply whatever comes after release/ as the label
# E.g. Merging into 'release/1.0' will add the label '1.0'
$1:
baseRegExp: "release[/](.*)"
14 changes: 14 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Branch Labeler

on:
pull_request:
types: [opened]

jobs:
label_prs:
runs-on: ubuntu-latest
steps:
- name: Label PRs
uses: TheCleric/pr-branch-labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
14 changes: 14 additions & 0 deletions .github/workflows/pr-sync-approval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto approval for sync PRs without conflicts
on:
pull_request:
types: [opened]
jobs:
approve_syncs:
runs-on: ubuntu-latest
steps:
- name: Approve sync PRs
uses: nrccua/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
label-list: sync
label-exclusion-list: conflicts,had conflicts,merge issues
47 changes: 47 additions & 0 deletions .github/workflows/pr-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Node Test for PRs

on:
pull_request:
branches:
- development
- staging
- "release/*"
- main

jobs:
test:
name: Install dependencies, test, and deploy a PR build
runs-on: ubuntu-latest
env:
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET }}-pr-${{ github.event.number }}
strategy:
matrix:
node: ["14"]
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- run: npm i
- run: npm run test
- name: Build
run: npm run build
- uses: romeovs/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./build/reports/jest/lcov.info

0 comments on commit 7a84926

Please sign in to comment.