Migrate _serializeForUrl
method to MLv2 (#37632)
#2
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.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@v3 | |
- name: Test which files changed | |
uses: dorny/[email protected] | |
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@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: "files-changed" | |
- name: Build static-viz frontend | |
run: yarn build-static-viz | |
- name: Upload Static Viz Bundle Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: static-viz-bundle-${{ github.sha }} | |
path: resources/frontend_client/app/dist | |
- name: Check for static viz changes | |
uses: dorny/[email protected] | |
id: static_viz | |
with: | |
token: ${{ github.token }} | |
filters: .github/static-viz-sources.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, 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 | |
env: | |
DOWNLOAD_URL: https://github.com/clj-kondo/clj-kondo/releases/download | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: 'kondo' | |
- 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 -d /usr/local/bin clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip | |
- run: clj-kondo --version | |
- 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@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, 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@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, 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@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 | |
# 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@v3 | |
with: | |
name: static-viz-bundle-${{ github.sha }} | |
path: resources/frontend_client/app/dist | |
- name: Run tests | |
id: run-java-tests | |
if: matrix.java-version != 21 | |
run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev | |
- name: Run tests using Java 21 on `master` only | |
id: run-java-tests-21 | |
if: matrix.java-version == 21 && github.ref_name == 'master' | |
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 }} | |
- 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@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, 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" |