Skip to content

Commit

Permalink
Merge pull request #1 from fkleon/feature-github-ci
Browse files Browse the repository at this point in the history
GitHub CI: Add test and release workflows
  • Loading branch information
fkleon authored Apr 30, 2024
2 parents fdfd2fd + 035bb26 commit e28aa07
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 70 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release the app to GitHub pages

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm ci
- run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: build/dist/

deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v4
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run code checks and tests

on:
push:
branches:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm ci
- run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- run: npm ci
- run: npm test
123 changes: 63 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"compile": "tsc",
"fix": "gts fix",
"prepare": "npm run compile",
"pretest": "npm run compile"
"pretest": "npm run compile",
"postinstall": "ln -sf ../ospec/bin/ospec node_modules/.bin/ospec"
},
"keywords": [],
"author": "Frederik Leonhardt <frederik.leonhardt@gmail.com>",
Expand All @@ -28,23 +29,23 @@
"devDependencies": {
"@types/jsdom": "^21.1.6",
"@types/mithril": "^2.2.6",
"@types/node": "20.8.2",
"@types/ospec": "^4.0.10",
"css-loader": "^6.10.0",
"css-loader": "^6.11.0",
"gts": "^5.3.0",
"html-webpack-plugin": "^5.6.0",
"jsdom": "^24.0.0",
"mini-css-extract-plugin": "^2.8.1",
"mini-css-extract-plugin": "^2.9.0",
"mithril-query": "github:mithriljs/mithril-query#facf7ce",
"ospec": "^4.2.0",
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"sass": "^1.75.0",
"sass-loader": "^14.2.1",
"style-loader": "^3.3.4",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"gts": "^5.2.0",
"@types/node": "20.8.2"
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"eslintConfig": {
"extends": "./node_modules/gts/",
Expand Down

0 comments on commit e28aa07

Please sign in to comment.