Skip to content

Commit

Permalink
ci(github): adds initial workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Nov 25, 2023
1 parent b67c169 commit d2ebbcb
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dispatch Test

on:
workflow_dispatch:

permissions:
checks: write
contents: write
pull-requests: write

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GH_TOKEN: ${{ github.token }}

jobs:
sanity-test:
name: Test
uses: ./.github/workflows/sanity-test.yml
with:
REF: ${{ github.ref }}
TOKEN: $GH_TOKEN
BRANCH_NAME: $BRANCH_NAME
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on:
pull_request:

permissions:
checks: write
contents: write
pull-requests: write

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
sanity-test:
name: Sanity Test
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/sanity-test.yml
with:
REF: ${{github.event.pull_request.head.ref}}
BRANCH_NAME: $BRANCH_NAME
49 changes: 49 additions & 0 deletions .github/workflows/sanity-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Sanity Tests

on:
workflow_call:
inputs:
TOKEN:
required: true
type: string
BRANCH_NAME:
required: true
type: string
REF:
required: true
type: string
REPOSITORY:
required: false
type: string

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
NODE_VERSION: 20

permissions:
contents: write
pull-requests: write

jobs:
sanity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ inputs.TOKEN }}
fetch-depth: 0
ref: ${{ inputs.REF }}

- name: ⬢ Setup Node & Cache
uses: actions/setup-node@v3
with:
cache: "npm"
cache-dependency-path: package-lock.json

- name: ↧ Install
run: npm ci

- name: 🧪 Test
run: |
npm run sanity-test

0 comments on commit d2ebbcb

Please sign in to comment.