This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
fix(deps): update dependency ts-jest to v29.2.1 (#441) #377
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: CI/CD | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
- '[0-9]+.x' | |
paths: | |
- src/** | |
- package-lock.json | |
- template.yaml | |
- .github/workflows/node-ci.yml | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
issues: write | |
jobs: | |
build: | |
name: Build & Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Lint the code | |
run: npm run lint:json | |
- name: Run unit tests | |
run: npm run test:cov | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-central-1 | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ServerlessAppManagementAccess | |
role-duration-seconds: 1800 | |
- name: Validate template | |
run: sam validate | |
- name: Create new release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
extra_plugins: | | |
@semantic-release/exec | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Retrieve package version | |
id: package-version | |
run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT | |
- name: Rewrite ESLint report for SonarCloud | |
run: sed -i "s+${GITHUB_WORKSPACE}+/github/workspace+g" eslint-report.json | |
- name: SonarCloud Scan | |
uses: SonarSource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.projectVersion=${{ steps.package-version.outputs.version }} |