generated from LizardByte/template-base
-
-
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
831324c
commit c4ff77e
Showing
15 changed files
with
1,221 additions
and
2 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,115 @@ | ||
--- | ||
# This workflow will run tests using node and then publish a package to GitHub Packages on push events to master. | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
setup_release: | ||
name: Setup Release | ||
outputs: | ||
publish_release: ${{ steps.setup_release.outputs.publish_release }} | ||
release_body: ${{ steps.setup_release.outputs.release_body }} | ||
release_commit: ${{ steps.setup_release.outputs.release_commit }} | ||
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }} | ||
release_tag: ${{ steps.setup_release.outputs.release_tag }} | ||
release_version: ${{ steps.setup_release.outputs.release_version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Release | ||
id: setup_release | ||
uses: LizardByte/setup-release-action@v2024.801.192524 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Test | ||
id: test | ||
env: | ||
FORCE_COLOR: true | ||
run: | | ||
npm test | ||
- name: Generate test results | ||
run: | | ||
jest --reporters=jest-junit | ||
- name: Upload test results to Codecov | ||
# any except canceled or skipped | ||
if: >- | ||
always() && | ||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | ||
startsWith(github.repository, 'LizardByte/') | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./junit.xml,!./cache | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
|
||
- name: Upload coverage | ||
# any except canceled or skipped | ||
if: >- | ||
always() && | ||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | ||
startsWith(github.repository, 'LizardByte/') | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
disable_search: true | ||
fail_ci_if_error: true | ||
files: ./coverage/coverage-final.json | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
|
||
publish-gpr: | ||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }} | ||
needs: | ||
- setup_release | ||
- build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
registry-url: https://npm.pkg.github.com/ | ||
|
||
- name: Update package.json | ||
run: npm version ${{ needs.setup_release.outputs.release_version }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_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,10 @@ | ||
# Ignore JetBrains IDE files | ||
.idea/ | ||
|
||
# Ignore node_modules | ||
node_modules/ | ||
package-lock.json | ||
|
||
# Ignore test coverage | ||
junit.xml | ||
coverage/ |
Oops, something went wrong.