This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
chore(deps): update dependency @types/node to v18.17.12 (#249) #200
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@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
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@v1 | |
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@v3 | |
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 }} |