EmmaLRussell is testing packit features #19
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: frontend-test | |
run-name: ${{ github.actor }} is testing packit features | |
on: | |
workflow_run: | |
workflows: [ "backend-test" ] | |
types: | |
- completed | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
- "mrc-*" | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
frontend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 22.x ] | |
java-version: [ 17 ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Use NodeJs ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Java JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: "temurin" | |
cache: "gradle" | |
- name: Build DB | |
uses: ./.github/actions/build-db | |
- name: Build API | |
uses: ./.github/actions/build-api | |
- name: Install dependencies | |
run: npm ci --prefix=app | |
- name: Check formatting with prettier | |
run: npm run format:check --prefix=app | |
- name: Run eslint | |
run: npm run lint --prefix=app | |
- name: Build app | |
run: npm run build --prefix=app | |
- name: Run unit tests | |
run: npm test --prefix=app -- --coverage | |
- name: Run dependencies and API | |
run: ./scripts/run-dependencies && ./api/scripts/run basicauth && ./api/scripts/smoke-test | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
- name: Build image | |
working-directory: app | |
run: ./scripts/build-and-push | |
- name: Run front end and smoke test | |
working-directory: app | |
run: ./scripts/run && ./scripts/smoke-test | |
- name: Create super user | |
run: ./scripts/basic-create-super-user | |
- name: Install playwright | |
working-directory: app | |
run: npx playwright install --with-deps | |
- name: Run app | |
working-directory: app | |
run: npm start & | |
- name: E2E tests | |
working-directory: app | |
run: npm run test:e2e | |
- name: Delete auth.json before E2E test-results upload | |
if: ${{ failure() }} | |
run: rm -rf app/test-results/auth.setup.ts-authenticate-setup/auth.json | |
- name: Upload E2E test reports | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: e2e test results | |
path: | | |
app/test-results/ |