-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
693b1f8
commit 441209b
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "*.md" | ||
branches: [main] | ||
tags: | ||
- "*" | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.npm | ||
~/.nvm | ||
~/work/react-assert/react-assert/node_modules | ||
~/work/react-assert/react-assert/package-lock.json | ||
key: ${{ runner.os }}-node_modules-cache-v3-${{ hashFiles('package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node_modules-cache-v3- | ||
- name: Extract Tag Name | ||
run: echo "TAG_NAME=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV | ||
if: ${{ startsWith(github.ref, 'refs/tags') }} | ||
|
||
- name: Run tests | ||
run: | | ||
npm i | ||
npm run formatCheck | ||
npx tsc | ||
NODE_V8_COVERAGE=coverage0 npx c8 -r lcovonly --all --src ./src node --experimental-test-coverage ./test/all.mjs | ||
if: ${{ env.TAG_NAME == '' }} | ||
|
||
- name: Report coverage to Coveralls | ||
uses: coverallsapp/github-action@v2 | ||
if: ${{ env.TAG_NAME == '' }} | ||
|
||
- name: Build SNAPSHOT | ||
run: npm pack | ||
if: ${{ env.TAG_NAME == '' }} | ||
|
||
- name: Publish RELEASE | ||
run: | | ||
VERSION="$(echo "$TAG_NAME" | cut -d'v' -f 2)" | ||
echo "Publish a release version=$VERSION for tag $TAG_NAME" | ||
npm --no-git-tag-version --allow-same-version version $VERSION | ||
npm pack | ||
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
npm publish react-assert-${VERSION}.tgz | ||
if: ${{ env.TAG_NAME != '' }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Bun CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "*.md" | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: "0.5.9" | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.bun/install/cache | ||
~/work/react-assert/react-assert/bun.lockb | ||
key: ${{ runner.os }}-bun-cache-v3-${{ hashFiles('package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-bun-cache-v3- | ||
- name: Run tests | ||
run: | | ||
bun install | ||
bun test |