-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Node version and ci actions
- Loading branch information
Showing
2 changed files
with
49 additions
and
49 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 |
---|---|---|
@@ -1,58 +1,58 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- main | ||
|
||
name: Push or PR | ||
name: Push or PR | ||
|
||
jobs: | ||
test: | ||
name: Build, Test and maybe Publish | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
node-version: [20.x] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.node-version }}-${{ runner.OS }}-npm-${{ hashFiles('package-lock.json') }} | ||
- name: Install deps | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: npm ci | ||
- name: ESLint | ||
run: npm run test:lint | ||
- name: Type checking | ||
run: npm run test:typecheck | ||
- name: Building packages | ||
run: npm run build | ||
- name: Unit testing (with GC) | ||
run: npm run test:unit:gc | ||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: changesets/action@v1 | ||
with: | ||
version: npx changeset version | ||
publish: npx changeset publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Send a notification if a publish happens | ||
if: steps.changesets.outputs.published == 'true' | ||
# You can do something when a publish happens. | ||
run: echo "A new version of ${GITHUB_REPOSITORY} was published!" | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ matrix.node-version }}-${{ runner.OS }}-npm-${{ hashFiles('package-lock.json') }} | ||
- name: Install deps | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: npm ci | ||
- name: ESLint | ||
run: npm run test:lint | ||
- name: Type checking | ||
run: npm run test:typecheck | ||
- name: Building packages | ||
run: npm run build | ||
- name: Unit testing (with GC) | ||
run: npm run test:unit:gc | ||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: changesets/action@v1 | ||
with: | ||
version: npx changeset version | ||
publish: npx changeset publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Send a notification if a publish happens | ||
if: steps.changesets.outputs.published == 'true' | ||
# You can do something when a publish happens. | ||
run: echo "A new version of ${GITHUB_REPOSITORY} was published!" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.