Merge branch 'upstream_release-x.47.x' into release-x.47.x #18
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] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CLJ_KONDO_VERSION: "2023.04.14" | |
jobs: | |
files-changed: | |
name: Check which files changed | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 3 | |
outputs: | |
backend_all: ${{ steps.changes.outputs.backend_all }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test which files changed | |
uses: dorny/[email protected] | |
id: changes | |
with: | |
token: ${{ github.token }} | |
filters: .github/file-paths.yaml | |
be-linter-cloverage: | |
needs: files-changed | |
if: github.ref_name == 'master' && needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 90 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "cloverage" | |
- name: Build static viz frontend | |
run: yarn build-static-viz | |
- name: Collect the test coverage | |
run: clojure -X:dev:ci:ee:ee-dev:test:cloverage | |
- name: Upload coverage to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./target/coverage/codecov.json | |
flags: back-end | |
be-linter-clj-kondo: | |
needs: files-changed | |
if: needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
env: | |
DOWNLOAD_URL: https://github.com/clj-kondo/clj-kondo/releases/download | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install clj-kondo | |
run: | | |
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip | |
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256 | |
cat clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256 >> SHA256sum.txt | |
echo " clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip" >> SHA256sum.txt | |
sha256sum -c SHA256sum.txt | |
unzip clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip | |
- run: ./clj-kondo --version | |
- name: Run clj-kondo | |
run: >- | |
./clj-kondo | |
--config ./.clj-kondo/config.edn | |
--config-dir ./.clj-kondo | |
--parallel | |
--lint | |
./src | |
./test | |
./enterprise/backend/src | |
./enterprise/backend/test | |
./shared/src | |
./shared/test | |
./modules/drivers/athena/src | |
./modules/drivers/athena/test | |
./modules/drivers/bigquery-cloud-sdk/src | |
./modules/drivers/bigquery-cloud-sdk/test | |
./modules/drivers/druid/src | |
./modules/drivers/druid/test | |
./modules/drivers/googleanalytics/src | |
./modules/drivers/googleanalytics/test | |
./modules/drivers/mongo/src | |
./modules/drivers/mongo/test | |
./modules/drivers/oracle/src | |
./modules/drivers/oracle/test | |
./modules/drivers/presto-jdbc/src | |
./modules/drivers/presto-jdbc/test | |
./modules/drivers/redshift/src | |
./modules/drivers/redshift/test | |
./modules/drivers/snowflake/src | |
./modules/drivers/snowflake/test | |
./modules/drivers/sparksql/src | |
./modules/drivers/sparksql/test | |
./modules/drivers/sqlite/src | |
./modules/drivers/sqlite/test | |
./modules/drivers/sqlserver/src | |
./modules/drivers/sqlserver/test | |
./modules/drivers/vertica/src | |
./modules/drivers/vertica/test | |
be-linter-eastwood: | |
needs: files-changed | |
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
if: github.event.pull_request.draft == true && needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
name: be-tests-java-11-ee-pre-check | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == '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] | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
- 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:${{ matrix.edition }}:${{ matrix.edition }}-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-${{ matrix.java-version }}-${{ matrix.edition }} | |
reporter: java-junit | |
list-suites: failed | |
list-tests: failed | |
fail-on-error: false | |
be-tests-stub: | |
needs: files-changed | |
if: | | |
always() && | |
github.event.pull_request.draft == false && | |
needs.files-changed.outputs.backend_all == 'false' | |
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] | |
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 | |
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true' | |
runs-on: ubuntu-22.04 | |
name: be-check-java-${{ matrix.java-version }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
java-version: [11, 17, 19] | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
if: | | |
always() && | |
github.event.pull_request.draft == false && | |
needs.files-changed.outputs.backend_all == 'false' | |
runs-on: ubuntu-22.04 | |
name: be-check-java-${{ matrix.java-version }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
java-version: [11, 17, 19] | |
steps: | |
- run: | | |
echo "Didn't run due to conditional filtering" |