david-mears-2 is testing packit backend features #1745
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: backend-test | |
run-name: ${{ github.actor }} is testing packit backend features | |
on: | |
workflow_run: | |
workflows: ["build-docker-db"] | |
types: | |
- completed | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
- "mrc-*" | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-version: [17] | |
steps: | |
- 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: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build DB | |
uses: ./.github/actions/build-db | |
- name: Run dependencies | |
run: ./scripts/run-dependencies | |
- name: Set up Java JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: "temurin" | |
cache: "gradle" | |
- name: Test backend | |
working-directory: api | |
run: ./gradlew :app:test --stacktrace --rerun | |
env: | |
PACKIT_GITHUB_CLIENT_ID: ${{ secrets.PACKIT_GITHUB_CLIENT_ID }} | |
PACKIT_GITHUB_CLIENT_SECRET: ${{ secrets.PACKIT_GITHUB_CLIENT_SECRET }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.PACKIT_GITHUB_ACCESS_TOKEN }} | |
- name: Lint | |
working-directory: api | |
run: ./gradlew :app:detekt | |
- name: Build image | |
working-directory: api | |
run: ./scripts/build-and-push | |
- name: Smoke test | |
working-directory: api | |
run: ./scripts/run && ./scripts/smoke-test |