Skip to content

Commit

Permalink
Add gh actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Dec 17, 2024
1 parent fa9b315 commit 52ab602
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy

on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

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

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

- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build project
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./demo/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on: push

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

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

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

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- run: npm run typecheck
- run: npm run test
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
1 change: 0 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { setupTypeAcquisition } from ".";
import * as Fs from "node:fs/promises";

async function reader(path: string) {
const recordings: Promise<{ url: string; text: string }>[] = [];
const m = new Map<string, string>(
JSON.parse(await Fs.readFile(path, "utf8")),
);
Expand Down

0 comments on commit 52ab602

Please sign in to comment.