Skip to content

Commit

Permalink
Add quality checks and dummy publish workflow (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nthurow authored Feb 9, 2024
1 parent c8fd711 commit 5b7c4f4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Dependencies
run: yarn install
shell: bash

- name: Check for changes to yarn.lock
run: git diff --exit-code
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
workflow_dispatch:

jobs:
quality_checks:
uses: Optum/react-hooks/.github/workflows/quality-checks.yml@add_quality_checks

publish:
runs-on: ubuntu-latest
needs: quality_checks
steps:
- name: Verify main branch
if: github.ref_name != 'main'
run: |
echo "Invalid branch: can only publish from main"
exit 1
- name: Setup
uses: Optum/react-hooks/.github/actions/setup@add_quality_checks

- name: Publish
run: echo Publishing...

27 changes: 27 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Quality Checks

on:
workflow_dispatch:
pull_request:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: Optum/react-hooks/.github/actions/setup@add_quality_checks

- name: Run TypeScript Build
run: yarn build

test:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: Optum/react-hooks/.github/actions/setup@add_quality_checks

- name: Run Unit Tests
run: yarn jest


0 comments on commit 5b7c4f4

Please sign in to comment.