-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(package): ajoute la config pour avoir un package npm
- Loading branch information
thierry behin
authored and
thierry behin
committed
Mar 17, 2023
1 parent
62d1ebb
commit ec270e1
Showing
5 changed files
with
160 additions
and
56 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,23 +1,23 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Lint | ||
run: | | ||
npm ci | ||
npm run lint | ||
- name: Test | ||
run: | | ||
npm run test | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Lint | ||
run: | | ||
npm ci | ||
npm run lint | ||
- name: Test | ||
run: | | ||
npm run test |
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,90 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: lighthouse-ecoindex-aggregator | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
skip_ci: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
canSkip: ${{ steps.check.outputs.canSkip }} | ||
steps: | ||
- id: check | ||
uses: Legorooj/skip-ci@main | ||
build: | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.skip_ci.outputs.canSkip != 'true' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GIT_TOKEN }} | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
if: github.ref == 'refs/heads/master' | ||
uses: mathieudutour/github-tag-action@v6.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
|
||
- name: set user name | ||
run: | | ||
git config --global user.email "ci@axa.fr" | ||
git config --global user.name "ci@axa.fr" | ||
- name: npm version ${{ steps.tag_version.outputs.new_tag }} | ||
if: github.ref == 'refs/heads/master' | ||
run: npm version ${{ steps.tag_version.outputs.new_tag }} | ||
|
||
- name: npm ci | ||
run: npm ci | ||
|
||
- name: npm test | ||
run: npm test -- --runInBand --coverage --watchAll=false | ||
|
||
- id: publish-aggregator | ||
uses: JS-DevTools/npm-publish@v1 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
package: ./package.json | ||
|
||
# - name: SonarCloud Scan | ||
# uses: sonarsource/sonarcloud-github-action@master | ||
# if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.head.repo.fork | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# with: | ||
# args: > | ||
# -Dsonar.organization=axaguildev | ||
# -Dsonar.projectKey=AxaGuilDEv_lighthouse-ecoindex-aggregator | ||
# -Dsonar.exclusions=**/*.spec.js,**/*.stories.js,Scripts/**,**/*.scss,**/__snapshots__/**,**/*[Tt]ests.cs,**/node_modules/**,**/ClientApp/build/**,**/ClientApp/.storybook/**,**/ClientApp/storybook-static/**,**/obj/**,**/__mocks__/**,**/ClientApp/src/serviceWorker.ts | ||
# -Dsonar.javascript.lcov.reportPaths=**/coverage/lcov.info | ||
|
||
- name: Commit updates package.json | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
commit_message: "[skip ci] Update version package.json" | ||
commit_user_name: GitHub | ||
commit_user_email: github-action@bot.com | ||
commit_author: GitHub <github-action@bot.com> | ||
push_options: "--force" | ||
|
||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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