-
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.
ci: 💚 add workflows and husky commitmsg hook
- Loading branch information
1 parent
bb8f53d
commit 0076ae5
Showing
3 changed files
with
74 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,17 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 16 * * 0' # sunday 16:00 | ||
|
||
jobs: | ||
quality_code: | ||
uses: nodecfdi/.github/.github/workflows/quality_code.yml@main | ||
|
||
tests: | ||
uses: nodecfdi/.github/.github/workflows/tests.yml@main |
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,56 @@ | ||
name: sonarcloud | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests-coverage: | ||
uses: nodecfdi/.github/.github/workflows/test_coverage.yml@main | ||
|
||
sonarcloud-secrets: | ||
name: SonarCloud check secrets are present | ||
runs-on: ubuntu-latest | ||
outputs: | ||
github: ${{ steps.check-secrets.outputs.github }} | ||
sonar: ${{ steps.check-secrets.outputs.sonar }} | ||
steps: | ||
- name: Check secrets are present | ||
id: check-secrets | ||
run: | | ||
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then | ||
echo "github=yes" >> $GITHUB_OUTPUT | ||
else | ||
echo "github=no" >> $GITHUB_OUTPUT | ||
echo "::warning ::GITHUB_TOKEN non set" | ||
fi | ||
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then | ||
echo "sonar=yes" >> $GITHUB_OUTPUT | ||
else | ||
echo "sonar=no" >> $GITHUB_OUTPUT | ||
echo "::warning ::SONAR_TOKEN non set" | ||
fi | ||
sonarcloud: | ||
name: SonarCloud Scan and Report | ||
needs: ['tests-coverage', 'sonarcloud-secrets'] | ||
if: ${{ needs.sonarcloud-secrets.outputs.github == 'yes' && needs.sonarcloud-secrets.outputs.sonar == 'yes' }} | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Unshallow clone to provide blame information | ||
run: git fetch --unshallow | ||
|
||
- name: Obtain code coverage | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: code-coverage | ||
path: coverage | ||
|
||
- name: SonarCloud Scan | ||
uses: sonarsource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_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 @@ | ||
commitlint --edit $1 |