diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b45b7aa5..90b5fbd3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,65 +1,23 @@ name: CI -on: +"on": push: - branches: [ main ] + branches: [main, dev] + pull_request: + branches: [main, dev] jobs: - build-and-deploy: + build: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Use Node.js 20.19 - uses: actions/setup-node@v4 - with: - node-version: '20.19' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - - name: Unit tests - run: npm run test:coverage - - - name: Sonar Cloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{secrets.TOKEN_FOR_WORKFLOWS}} - SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} - - - name: E2E tests - run: ./scripts/conditional-e2e.sh - shell: bash - continue-on-error: true - - - name: Build for deployment - run: npm run build -- --configuration=production --base-href=/admin-app/ - - - name: Validate build artifacts - run: | - if [ ! -d "dist/admin-app" ]; then - echo "ERROR: Build artifacts not found" - exit 1 - fi - if [ -z "$(ls -A dist/admin-app)" ]; then - echo "ERROR: Build directory is empty" - exit 1 - fi - echo "✓ Build artifacts validated" - - - name: Deploy to GitHub pages - env: - USERNAME: ${{secrets.USERNAME_FOR_WORKFLOWS}} - GITHUB_API_KEY: ${{secrets.TOKEN_FOR_WORKFLOWS}} - GITHUB_WORKSPACE: ${{github.workspace}} - CI: true - run: ./scripts/deploy.sh - shell: bash + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.19" + cache: npm + - run: npm ci + - run: npm run lint + - run: npm run test:coverage + - run: npm run build -- --configuration=production --base-href=/admin-app/ + - name: Validate build artifacts + run: test -d dist/admin-app && test -n "$(ls -A dist/admin-app)" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6ac6ccbf..10a7e81d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,24 +1,12 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" +name: CodeQL -on: +"on": push: - branches: [ main ] + branches: [main, dev] pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main, dev] schedule: - - cron: '45 15 * * 1' + - cron: "45 15 * * 1" jobs: analyze: @@ -28,44 +16,18 @@ jobs: actions: read contents: read security-events: write - strategy: fail-fast: false matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - + language: [javascript] steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3