CrateDB: Subtract features from PostgreSQL adapter to make CrateDB work #3
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 | |
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 | |
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') | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: 'kondo' | |
- name: Run clj-kondo | |
run: ./bin/kondo.sh | |
be-linter-eastwood: | |
needs: [files-changed, static-viz-files-changed] | |
if: | | |
!cancelled() && | |
github.event.pull_request.draft == false && | |
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "eastwood" | |
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood | |
name: Run Eastwood linter | |
# Because it's not possible to conditionally run only `java-11-ee` test in the draft mode, | |
# we have to extract that job manually here. Backend developers have requested that this | |
# test runs at all times to give them an early warning sign is something is broken. | |
be-tests-java-11-ee-pre-check: | |
needs: [files-changed, static-viz-files-changed] | |
if: | | |
!cancelled() && | |
github.event.pull_request.draft == true && | |
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') | |
runs-on: ubuntu-22.04 | |
name: be-tests-java-11-ee-pre-check | |
timeout-minutes: 60 | |
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: java-11-ee-pre-check | |
- run: yarn install --frozen-lockfile --prefer-offline | |
- name: Build static viz frontend | |
run: yarn build-static-viz | |
- name: Run tests | |
run: clojure -X:dev:ci:test:ee:ee-dev | |
- name: Publish Test Report (JUnit) | |
uses: dorny/test-reporter@v1 | |
if: failure() | |
with: | |
path: "target/junit/**/*_test.xml" | |
name: JUnit Test Report be-tests-java-11-ee-pre-check | |
reporter: java-junit | |
list-suites: failed | |
list-tests: failed | |
fail-on-error: false | |
be-tests: | |
needs: [files-changed, static-viz-files-changed] | |
if: | | |
!cancelled() && | |
github.event.pull_request.draft == false && | |
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') | |
runs-on: ubuntu-22.04 | |
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
edition: [oss, ee] | |
java-version: [11, 17, 21] | |
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: be-tests | |
# Depending on which files changed, we might either have to build static-viz | |
# from scratch or download the previously built artifact | |
- name: Build static-viz frontend | |
if: needs.files-changed.outputs.backend_all == 'true' | |
run: yarn build-static-viz | |
- name: Download Static Viz Bundle Artifact | |
if: needs.static-viz-files-changed.outputs.static_viz == 'true' | |
uses: actions/download-artifact@v4 | |
with: | |
name: static-viz-bundle-${{ github.sha }} | |
path: resources/frontend_client/app/dist | |
- name: Run tests | |
id: run-java-tests | |
run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev | |
- name: Upload Test Results | |
uses: ./.github/actions/upload-test-results | |
if: always() && (steps.run-java-tests.conclusion != 'skipped' || steps.run-java-tests-21.conclusion != 'skipped') | |
with: | |
input-path: ./target/junit/ | |
output-name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} | |
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }} | |
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }} | |
- name: Publish Test Report (JUnit) | |
uses: dorny/test-reporter@v1 | |
if: failure() | |
with: | |
path: "target/junit/**/*_test.xml" | |
name: JUnit Test Report be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} | |
reporter: java-junit | |
list-suites: failed | |
list-tests: failed | |
fail-on-error: false | |
be-tests-stub: | |
needs: [be-tests] | |
if: | | |
!cancelled() && | |
github.event.pull_request.draft == false && needs.be-tests.result == 'skipped' | |
runs-on: ubuntu-22.04 | |
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }} | |
timeout-minutes: 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
edition: [oss, ee] | |
java-version: [11, 17, 21] | |
steps: | |
- run: | | |
echo "Didn't run due to conditional filtering" | |
# checks that all the namespaces we actually ship can be compiled, without any dependencies that we don't ship (such | |
# as `:dev` dependencies). See #27009 for more context. | |
be-check: | |
needs: [files-changed, static-viz-files-changed] | |
if: | | |
!cancelled() && | |
github.event.pull_request.draft == false && | |
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true') | |
runs-on: ubuntu-22.04 | |
name: be-check-java-${{ matrix.java-version }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
java-version: [11, 17, 21] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare backend | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: be-check | |
- name: Check namespaces | |
run: clojure -M:ee:drivers:check | |
be-check-stub: | |
needs: [files-changed, static-viz-files-changed, be-check] | |
if: | | |
always() && | |
github.event.pull_request.draft == false && | |
needs.be-check.result == 'skipped' | |
runs-on: ubuntu-22.04 | |
name: be-check-java-${{ matrix.java-version }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
java-version: [11, 17, 21] | |
steps: | |
- run: | | |
echo "Didn't run due to conditional filtering" | |
be-cljfmt: | |
needs: [files-changed] | |
if: | | |
!cancelled() && needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: 'cljfmt' | |
- name: Run cljfmt | |
run: clojure -T:cljfmt check |