Skip to content

Merge pull request #178 from RHSplinter/dependabot/github_actions/git… #607

Merge pull request #178 from RHSplinter/dependabot/github_actions/git…

Merge pull request #178 from RHSplinter/dependabot/github_actions/git… #607

Workflow file for this run

name: CI Build
on:
push:
paths-ignore:
- "**.md"
- "LICENSE.txt"
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Build application
run: npm run build:prod
- name: Run unit tests
id: unit-tests
run: npm run test:prod
- name: Upload Test Result Report
if: steps.unit-tests.conclusion != 'skipped'
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
with:
name: Test Results
path: test_results/test-output.xml
reporter: java-junit
report-title: Test Results
- name: Create Code Coverage Summary Report
if: steps.unit-tests.conclusion != 'skipped'
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 #v1.3.0
with:
filename: "test_results/coverage/cobertura-coverage.xml"
badge: true
format: "markdown"
output: "both"
- name: Upload Code Coverage Report
if: steps.unit-tests.conclusion != 'skipped'
run: |
echo "# Code Coverage" >> $GITHUB_STEP_SUMMARY
if [ -f code-coverage-results.md ]; then
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
else
echo "Coverage report not found" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload build artifacts
id: artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: devtoolbox-artifacts
path: dist/dev-tool-box/browser/
retention-days: 5
if-no-files-found: error
e2e:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
strategy:
matrix:
browser: [chrome, firefox, edge]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: devtoolbox-artifacts
path: dist/dev-tool-box/browser/
- name: Run E2E tests
uses: cypress-io/github-action@948d67d3074f1bbb6379c8bdbb04e95d2f8e593f # v7.4.0
with:
start: npm run start
wait-on: http://localhost:4200
browser: ${{ matrix.browser }}
record: false
spec: cypress/e2e/**/*.cy.ts
- name: Upload Cypress screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
name: cypress-screenshots-${{ matrix.browser }}
path: cypress/screenshots/
retention-days: 7
if-no-files-found: ignore
- name: Upload Cypress videos
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: cypress-videos-${{ matrix.browser }}
path: cypress/videos/
retention-days: 7
if-no-files-found: ignore