Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
backend.yml 9.62 KiB
name: Backend

on:
  push:
    branches:
      - "master"
      - "release-**"
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review, labeled]

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  cancel-in-progress: true

env:
  CLJ_KONDO_VERSION: "2023.09.07"

jobs:
  files-changed:
    name: Check which files changed
    runs-on: ubuntu-22.04
    timeout-minutes: 5
    outputs:
      backend_all: ${{ steps.changes.outputs.backend_all }}
      frontend_sources: ${{ steps.changes.outputs.frontend_sources }}
    steps:
      - uses: actions/checkout@v4
      - name: Test which files changed
        uses: dorny/paths-filter@v3.0.0
        id: changes
        with:
          token: ${{ github.token }}
          filters: .github/file-paths.yaml

  static-viz-files-changed:
    needs: files-changed
    if: needs.files-changed.outputs.backend_all != 'true' && needs.files-changed.outputs.frontend_sources == 'true'
    name: Check whether static-viz files changed
    runs-on: ubuntu-22.04
    timeout-minutes: 10
    outputs:
      static_viz: ${{ steps.static_viz.outputs.static_viz }}
    steps:
      - uses: actions/checkout@v4
      - name: Prepare front-end environment
        uses: ./.github/actions/prepare-frontend
      - name: Prepare back-end environment
        uses: ./.github/actions/prepare-backend
        with:
          m2-cache-key: "files-changed"
      - name: Build static-viz frontend
        run: yarn build-static-viz
      - name: Upload Static Viz Bundle Artifact
        uses: actions/upload-artifact@v4
        with:
          name: static-viz-bundle-${{ github.sha }}
          path: resources/frontend_client/app/dist

      - name: Check for static viz changes
        uses: dorny/paths-filter@v3.0.0
        id: static_viz
        with:
          token: ${{ github.token }}
          filters: .github/static-viz-sources.yaml

  be-linter-clj-kondo:
    needs: [files-changed, static-viz-files-changed]
    if: |
      !cancelled() &&
      (needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')