Skip to content

Commit

Permalink
Run backend tests only on backend code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Apr 29, 2024
1 parent df6cdd1 commit 950eec4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 30 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: backend-tests

on:
push:
paths:
- "backend/**"
- ".github/workflows/backend-tests.yml"
workflow_dispatch:

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-backend-tests
cancel-in-progress: true

jobs:
Tests:
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
env:
CROSSREF_USERNAME: ${{ secrets.CROSSREF_USERNAME }}
CROSSREF_TEST_PASSWORD: ${{ secrets.CROSSREF_TEST_PASSWORD }}
CROSSREF_TEST_ENDPOINT: ${{ secrets.CROSSREF_TEST_ENDPOINT }}
CROSSREF_DOI_PREFIX: ${{ secrets.CROSSREF_DOI_PREFIX }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Execute Tests
uses: nick-fields/retry@v3
with:
command: cd ./backend && ./gradlew test
max_attempts: 3
timeout_minutes: 10
retry_wait_seconds: 1
- name: Check Format And Lint
run: ./gradlew ktlintCheck
working-directory: ./backend
32 changes: 2 additions & 30 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,17 @@ on:
push:
workflow_dispatch:

env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/backend
CROSSREF_USERNAME: ${{ secrets.CROSSREF_USERNAME }}
CROSSREF_TEST_PASSWORD: ${{ secrets.CROSSREF_TEST_PASSWORD }}
CROSSREF_TEST_ENDPOINT: ${{ secrets.CROSSREF_TEST_ENDPOINT }}
CROSSREF_DOI_PREFIX: ${{ secrets.CROSSREF_DOI_PREFIX }}

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-backend
cancel-in-progress: true

jobs:
Tests:
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Execute Tests
uses: nick-fields/retry@v3
with:
command: cd ./backend && ./gradlew test
max_attempts: 3
timeout_minutes: 10
retry_wait_seconds: 1
- name: Check Format And Lint
run: ./gradlew ktlintCheck
working-directory: ./backend

dockerImage:
name: Build Backend Docker Image # Don't change: Referenced by .github/workflows/update-argocd-metadata.yml
runs-on: ubuntu-latest
timeout-minutes: 15
env:
DOCKER_IMAGE_NAME: ghcr.io/loculus-project/backend
permissions:
packages: write
contents: read
Expand Down

0 comments on commit 950eec4

Please sign in to comment.