Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI workflow improvements #43

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: PR Checks

on:
push:
Expand All @@ -21,4 +21,5 @@ jobs:
cache: yarn
- run: yarn
- run: yarn build
- run: yarn prettier:check
- run: yarn test --maxWorkers 2
12 changes: 7 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Node.js CI
name: GitHub Pages

on:
push:
branches: [ main ]
branches: [main]

jobs:
gh-pages:
Expand All @@ -18,9 +18,11 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: npx typedoc
- run: yarn typedoc
- run: yarn coverage
- run: yarn build:pages
- name: Publish to gh-pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./typedocs
publish_dir: ./gh-pages
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Node.js CI
name: Release

on:
push:
branches: [ main ]
branches: [main, next]

jobs:
release:
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/next') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -17,9 +18,10 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn
- run: yarn test
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn prettier:check
- run: yarn test --maxWorkers 2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
coverage
/coverage/
*.lcov

# nyc test coverage
Expand Down Expand Up @@ -122,3 +122,4 @@ es2020/

/docs/
/typedocs/
/gh-pages/
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,55 @@
"typings": "lib/index.d.ts",
"scripts": {
"prettier": "prettier --ignore-path .gitignore --write 'src/**/*.{ts,tsx,js,jsx}'",
"prettier:diff": "prettier -l 'src/**/*.{ts,tsx,js,jsx}'",
"prettier:check": "prettier --check 'src/**/*.{ts,tsx,js,jsx}'",
"tslint": "tslint 'src/**/*.{js,jsx,ts,tsx}' -t verbose",
"lint": "yarn tslint",
"clean": "rimraf lib es6 es2020",
"clean": "rimraf lib es6 es2020 coverage typedocs gh-pages",
"build:cjs": "tsc",
"build:es6": "tsc --module commonjs --target es6 --outDir es6",
"build:es2020": "tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir es2020",
"build": "yarn build:cjs && yarn build:es6 && yarn build:es2020",
"test": "jest --no-cache --config='jest.config.js'",
"release": "semantic-release"
"coverage": "yarn test --collectCoverage",
"typedoc": "npx typedoc@0.25.13 --tsconfig tsconfig.build.json",
"build:pages": "npx rimraf@5.0.5 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage",
"deploy:pages": "gh-pages -d gh-pages"
},
"keywords": [],
"dependencies": {},
"peerDependencies": {
"tslib": "^2"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/git": "^10.0.0",
"@semantic-release/npm": "^8.0.2",
"@types/jest": "^29.5.12",
"husky": "^8.0.0",
"jest": "^29.7.0",
"prettier": "^3.0.0",
"pretty-quick": "^3.1.1",
"rimraf": "^3.0.2",
"semantic-release": "^18.0.0",
"ts-jest": "^29.1.2",
"tslint": "^6.1.3",
"tslint-config-common": "^1.6.2",
"typescript": "^5.0.3",
"tslib": "^2.6.2"
},
"release": {
"verifyConditions": [
"branches": [
"main",
{
"name": "next",
"prerelease": true
}
],
"prepare": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git"
],
"prepare": [
"verifyConditions": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git"
],
"branches": [
"main"
]
}
}