Skip to content

absternator is testing packit features #1778

absternator is testing packit features

absternator is testing packit features #1778

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: [16.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: Login 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: Installing dependencies
run: npm ci --prefix=app
- name: Building app
run: npm run build --prefix=app
- name: Running eslint
run: npm run lint --prefix=app
- name: Testing app
run: npm test --prefix=app -- --coverage
- name: Run dependencies
run: ./scripts/run-dependencies && ./api/scripts/run && ./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: Smoke test
working-directory: app
run: ./scripts/run && ./scripts/smoke-test