Skip to content

Commit

Permalink
Move core of CI to GitHub (#32)
Browse files Browse the repository at this point in the history
I liked putting early development on SourceHut, but for the moment it makes collaboration with folks here more difficult. Will need to test NPM publication after merge. Addresses #28.
  • Loading branch information
robsimmons authored Jun 8, 2024
1 parent 99aec9d commit 39f47fd
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 9 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check that everything builds correctly

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test-building:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci

- name: Build package
run: npm run lib

- name: Build website
run: npm run build

- name: Build docs
run: |
cd docs
npm ci
npm run build
31 changes: 31 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run static checks

on:
push:
pull_request:
workflow_dispatch:

jobs:
run-static-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci

- name: Check formatting with prettier
run: npm run prettier:check

- name: Check for issues with eslint
run: npm run lint

- name: Check for type errors with typescript
run: npm run tsc

- name: Run unit tests
run: npm run test
22 changes: 18 additions & 4 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ name: Submit to coveralls

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test:
submit-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci
- run: npm run coverage
- uses: coverallsapp/github-action@v2

- name: Test
run: npm run coverage

- name: Submit
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish NPM Package

on:
push:
branches:
- publish
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci

- name: Build package
run: npm run lib

- name: Publish package
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_PUBLISH_TOKEN }}'
run: npm publish
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set programming.

- Dusa lives online at [dusa.rocks](https://dusa.rocks/).
- Documentation lives at [dusa.rocks/docs](https://dusa.rocks/docs/)
- [Source code at sourcehut](https://git.sr.ht/~robsimmons/dusa)
- [Issue tracker at sourcehut](https://todo.sr.ht/~robsimmons/Dusa)
- [Source code on GitHub](https://github.com/robsimmons/dusa)
- [Issue tracker at GitHub](https://github.com/robsimmons/dusa/issues)

Dusa was initially developed by Rob Simmons and Chris Martens while Rob attended
[Recurse Center](https://www.recurse.com/) in Fall 2023. Recurse center is a
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dusa",
"version": "0.0.13",
"version": "0.0.14",
"type": "module",
"main": "lib/client.js",
"types": "lib/client.d.ts",
Expand Down

0 comments on commit 39f47fd

Please sign in to comment.