chore: Use separate users for collector service, lister service, and … #74
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: X-Road-Catalog tests | |
on: | |
# Capture this event so that gradle caches are updated when a PR is merged to develop | |
# More information on why: https://github.com/gradle/gradle-build-action#using-the-caches-read-only | |
push: | |
branches: | |
- develop | |
paths: | |
- 'xroad-catalog-collector/src/**' | |
- 'xroad-catalog-lister/src/**' | |
- 'xroad-catalog-persistence/src/**' | |
- '.github/**' | |
- 'gradle/libs.versions.toml' # So that dependabot PRs are tested | |
- 'xroad-catalog-collector/packages/**' | |
- 'xroad-catalog-lister/packages/**' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'xroad-catalog-collector/src/**' | |
- 'xroad-catalog-lister/src/**' | |
- 'xroad-catalog-persistence/src/**' | |
- '.github/**' | |
- 'gradle/libs.versions.toml' # So that dependabot PRs are tested | |
permissions: | |
contents: write # Required for https://github.com/gradle/actions/tree/main/setup-gradle#github-dependency-graph-support | |
pull-requests: write # https://github.com/gradle/actions/tree/main/setup-gradle#adding-job-summary-as-a-pull-request-comment | |
actions: read # Required for https://github.com/dorny/test-reporter | |
checks: write # Required for https://github.com/dorny/test-reporter | |
jobs: | |
BuildAndTest: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | |
gradle-home-cache-cleanup: true | |
dependency-graph: generate-and-submit | |
add-job-summary-as-pr-comment: always | |
- name: Run tests | |
run: ./gradlew build test --stacktrace | |
- name: Test report | |
env: | |
NODE_OPTIONS: '--max-old-space-size=6144' | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
with: | |
name: Test results | |
path: ./**/build/test-results/**/TEST-*.xml | |
reporter: java-junit | |
list-suites: 'failed' | |
list-tests: 'failed' | |
- name: Build collector RPM package builder | |
run: docker build -t collector-rpm xroad-catalog-collector/packages/xroad-catalog-collector/docker | |
- name: Run collector RPM package builder | |
run: docker run -v $PWD:/workspace collector-rpm | |
- name: Build lister RPM package builder | |
run: docker build -t lister-rpm xroad-catalog-lister/packages/xroad-catalog-lister/docker | |
- name: Run lister RPM package builder | |
run: docker run -v $PWD:/workspace lister-rpm |