name: ๐Ÿท๏ธ Release Creation Workflow on: push: branches: - 'main' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} jobs: code-ql: name: CodeQL Scan โ‡๏ธ runs-on: ubuntu-latest timeout-minutes: 360 permissions: actions: read contents: read security-events: write steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 - name: Initialize CodeQL โš™๏ธ uses: github/codeql-action/init@v3 with: languages: javascript - name: AutoBuild ๐ŸŒก๏ธ uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis โ‡๏ธ uses: github/codeql-action/analyze@v3 with: category: "/language:javascript" install: name: Install โš™๏ธ runs-on: ubuntu-latest steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 - name: Install pnpm ๐Ÿ—๏ธ uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Setup NodeJS โœจ uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Cache pnpm dependencies ๐Ÿฅก uses: actions/cache@v3 id: cache-node-modules with: path: node_modules key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }} - name: Install project dependencies ๐Ÿ“ฆ run: pnpm install if: steps.cache-node-modules.outputs.cache-hit != 'true' mutant-tests: name: Mutant Tests ๐Ÿ‘ฝ runs-on: ubuntu-latest env: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} VERSION: 'main' needs: - install steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 - name: Install pnpm ๐Ÿ—๏ธ uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Setup NodeJS โœจ uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Restore pnpm dependencies from cache ๐Ÿฅก uses: actions/cache/restore@v3 id: cache-node-modules with: path: node_modules key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }} - name: Create Nuxt types โ›ฐ๏ธ run: pnpm run postinstall - name: Mutant tests ๐Ÿ‘ฝ run: pnpm run test:stryker:ci - name: Save stryker report as artifact ๐Ÿ’Ž uses: actions/upload-artifact@v4 with: name: stryker-html-report path: tests/stryker/coverage/index.html release: name: Release ๐Ÿท๏ธ runs-on: ubuntu-latest needs: - install steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 with: persist-credentials: false - name: Install pnpm ๐Ÿ—๏ธ uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Setup NodeJS โœจ uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Restore pnpm dependencies from cache ๐Ÿฅก uses: actions/cache/restore@v3 id: cache-node-modules with: path: node_modules key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }} - name: Release ๐Ÿท๏ธ id: release run: npx semantic-release outputs: new-release-published: ${{ steps.release.outputs.new-release-published }} new-release-version: ${{ steps.release.outputs.new-release-version }} unit-tests: name: Unit Tests ๐Ÿงช runs-on: ubuntu-latest needs: - install steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 - name: Install pnpm ๐Ÿ—๏ธ uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Setup NodeJS โœจ uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: 'pnpm' - name: Restore pnpm dependencies from cache ๐Ÿฅก uses: actions/cache/restore@v3 id: cache-node-modules with: path: node_modules key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }} - name: Create Nuxt types โ›ฐ๏ธ run: pnpm run postinstall - name: Unit tests ๐Ÿงช run: pnpm run test:unit:cov - name: Save tests coverage in cache ๐Ÿฅก uses: actions/cache/save@v3 id: cache-unit-tests-coverage with: path: tests/unit/coverage key: ${{ runner.os }}-tests-unit-coverage-v3-${{hashFiles('tests/unit/coverage/lcov.info')}} - name: Save unit tests coverage report as artifact ๐Ÿ’Ž uses: actions/upload-artifact@v4 with: name: unit-tests-coverage-report path: tests/unit/coverage sonarcloud: name: SonarCloud Analysis ๐ŸŒฅ๏ธ runs-on: ubuntu-latest needs: - unit-tests steps: - name: Checkout GitHub repository ๐Ÿ“ก uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install pnpm ๐Ÿ—๏ธ uses: pnpm/action-setup@v2 with: version: 8 run_install: false - name: Restore pnpm dependencies from cache ๐Ÿฅก uses: actions/cache/restore@v3 id: cache-node-modules with: path: node_modules key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }} - name: Restore tests coverage from cache ๐Ÿฅก uses: actions/cache/restore@v3 id: cache-unit-tests-coverage with: path: tests/unit/coverage key: ${{ runner.os }}-tests-unit-coverage-v3- restore-keys: | ${{ runner.os }}-tests-unit-coverage-v3- - name: Create Nuxt types โ›ฐ๏ธ run: pnpm run postinstall - name: SonarCloud Scan ๐ŸŒฅ๏ธ uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}