Airbyte Platform CI #2
This file contains hidden or 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: Airbyte Platform CI | |
env: | |
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} | |
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} | |
on: | |
#ability to start task manually in Web UI | |
workflow_dispatch: | |
inputs: | |
debug_mode: | |
description: "Enable or disable tmate session for debug during helm ac tests" | |
type: choice | |
default: "false" | |
options: | |
- "true" | |
- "false" | |
required: false | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: write-all | |
jobs: | |
platform-build: | |
name: "Platform: Build" | |
runs-on: "ubuntu" | |
# In case of self-hosted EC2 errors, remove the next two lines and uncomment the currently commented out `runs-on` line. | |
# needs: start-platform-build-runner # required to start the main job when the runner is ready | |
# runs-on: ${{ needs.start-platform-build-runner.outputs.label }} # run the job on the newly created runner | |
timeout-minutes: 90 | |
steps: | |
- name: Checkout Airbyte | |
uses: actions/checkout@v3 | |
- name: Cache Build Artifacts | |
uses: ./.github/actions/cache-build-artifacts | |
with: | |
cache-key: ${{ secrets.CACHE_VERSION }} | |
cache-python: "false" | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/*" | |
- name: Set up CI Gradle Properties | |
run: | | |
mkdir -p ~/.gradle/ | |
cat > ~/.gradle/gradle.properties <<EOF | |
org.gradle.jvmargs=-Xmx8g -Xss4m \ | |
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ | |
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ | |
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ | |
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ | |
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | |
org.gradle.workers.max=8 | |
org.gradle.vfs.watch=false | |
EOF | |
- name: Format | |
uses: Wandalen/[email protected] | |
with: | |
command: ./gradlew format --scan --info --stacktrace | |
attempt_limit: 3 | |
attempt_delay: 5000 # in ms | |
- name: Ensure no file change | |
run: git --no-pager diff && test -z "$(git --no-pager diff)" | |
- name: Build | |
uses: Wandalen/[email protected] | |
with: | |
command: ./gradlew build javadoc --scan | |
attempt_limit: 3 | |
attempt_delay: 5000 # in ms | |
- name: Add coverage to PR | |
if: github.event_name == 'pull_request' | |
id: jacoco | |
uses: madrapps/[email protected] | |
with: | |
# todo(mfsiega-airbyte): when v1.4 is released, use wildcards per https://github.com/Madrapps/jacoco-report/issues/20. | |
paths: | | |
${{ github.workspace }}/airbyte-analytics/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-api/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-bootloader/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-commons/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-commons-protocol/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-commons-temporal/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-commons-worker/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-config/init/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-config/specs/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-config/config-persistence/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-config/config-models/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-container-orchestrator/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-db/db-lib/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-json-validation/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-metrics/reporter/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-metrics/metrics-lib/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-notification/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-oauth/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-persistence/job-persistence/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-server/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-test-utils/build/reports/jacoco/test/jacocoTestReport.xml, | |
${{ github.workspace }}/airbyte-workers/build/reports/jacoco/test/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 25 | |
min-coverage-changed-files: 60 | |
title: Airbyte Code Coverage | |
update-comment: true | |
debug-mode: false | |
- name: Test if Seed spec is updated | |
uses: Wandalen/[email protected] | |
with: | |
command: ./gradlew format && git --no-pager diff && test -z "$(git --no-pager diff)" | |
attempt_limit: 3 | |
attempt_delay: 5000 # in ms | |
# todo (cgardens) - scope by platform. | |
- name: Check documentation | |
if: success() && github.ref == 'refs/heads/main' | |
run: ./tools/site/link_checker.sh check_docs | |
# This is only required on the usual github runner. The usual runner does not contain enough disk space for our use. | |
# - name: Get Docker Space | |
# run: docker run --rm busybox df -h | |
- name: Run End-to-End Acceptance Tests | |
uses: Wandalen/[email protected] | |
with: | |
command: ./tools/bin/acceptance_test.sh | |
attempt_limit: 3 | |
attempt_delay: 5000 # in ms | |
- uses: actions/setup-python@v4 | |
if: always() | |
with: | |
python-version: "3.9" | |