Skip to content

Commit

Permalink
Merge branch 'main' into fix-build-preventing-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stolsky authored Nov 21, 2023
2 parents 60c55ec + 20b23e4 commit d77c0cc
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
workflow_call:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Upload build
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy

on:
pull_request:
types:
- closed
branches:
- master
workflow_dispatch:

jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml

build:
name: Build
needs: [ tests ]
uses: ./.github/workflows/build.yml

deploy:
name: Deploy
if: github.event.pull_request.merged == true
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
pull_request:
branches:
- master
workflow_call:
workflow_dispatch:

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Run Tests
run: npm run test

- name: Run Test Coverage
id: coverage
run: npm run coverage

0 comments on commit d77c0cc

Please sign in to comment.