Update update-finished-note.md #72
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
name: Backend Application API Build | |
on: | |
push: | |
branches: [ "main", "release" ] | |
pull_request: | |
branches: [ "main", "release" ] | |
jobs: | |
initialize-app: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ 18 ] | |
name: Cache Node dependencies | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install Packages | |
run: | | |
npm i | |
- name: Cache Node Modules | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./node_modules | |
key: node-modules-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
- name: Cache package-lock.json | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./package-lock.json | |
key: package-lock-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
test-and-lint: | |
runs-on: ubuntu-latest | |
needs: initialize-app | |
if: ${{ (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/main') }} | |
strategy: | |
matrix: | |
node: [ 18 ] | |
name: Test And Linting NodeJS v${{ matrix.node }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Use Cached Node Modules | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./node_modules | |
key: node-modules-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
- name: Use Cached package-lock.json | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./package-lock.json | |
key: package-lock-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
- name: Linting | |
run: | | |
npm run linting | |
- name: Testing | |
run: | | |
npm run test | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Coverage Report | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./coverage | |
key: coverage-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
analyze-code: | |
runs-on: ubuntu-latest | |
needs: test-and-lint | |
if: ${{ (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/main') }} | |
name: Sonar Cloud Scan | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Cached Coveraged Report | |
uses: actions/cache@v3.2.3 | |
with: | |
path: ./coverage | |
key: coverage-app-cache-key.${{ github.ref }}.${{ github.sha }} | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |