Skip to content

Commit

Permalink
ci: Add tests workflow (#3)
Browse files Browse the repository at this point in the history
* ci: Add tests workflow

* Update pnpm-lock.yaml

* Add linting

* Rename to CI

* Untrack ohm-bundle files

* Fix formatting

* Fix linting

* Update pnpm
  • Loading branch information
Twixes authored Jul 31, 2023
1 parent fd4db22 commit 951aa2d
Show file tree
Hide file tree
Showing 10 changed files with 5,576 additions and 4,187 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- main
pull_request:

name: CI

jobs:
test:
name: Unit tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 19, 20]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm compile:ohm
- run: pnpm test

lint:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm format:check
- run: pnpm lint:check
26 changes: 13 additions & 13 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
on:
push:
branches:
- main
push:
branches:
- main

permissions:
contents: write
pull-requests: write
contents: write
pull-requests: write

name: release-please
name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: pip-requirements-js
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: pip-requirements-js
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
src/*.ohm-bundle.*
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0"
}
".": "0.1.0"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"main": "dist/index.js",
"homepage": "https://github.com/Twixes/pip-requirements-js#readme",
"repository": "Twixes/pip-requirements-js",
"packageManager": "[email protected]",
"scripts": {
"prepare": "husky install",
"lint": "eslint --fix 'src/**'",
"lint:check": "eslint 'src/**'",
"lint": "eslint --fix src/",
"lint:check": "eslint src/",
"format": "prettier --write .",
"format:check": "prettier --check .",
"clean": "rimraf dist",
Expand Down Expand Up @@ -50,7 +51,7 @@
"typescript": "^5.1.6"
},
"lint-staged": {
"*.{js,json,md}": "prettier --write",
"*.{js,json,md,yml,yaml}": "prettier --write",
"src/*.ts": [
"prettier --write",
"eslint --fix"
Expand Down
Loading

0 comments on commit 951aa2d

Please sign in to comment.