-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run unit and integration tests on github actions
- Loading branch information
1 parent
370bd7e
commit 2f5518e
Showing
8 changed files
with
232 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Code quality | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
- stable/* | ||
pull_request: | ||
jobs: | ||
codeql: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: java | ||
queries: +security-and-quality | ||
- name: Build | ||
run: mvn -B -T1C -DskipTests -DskipChecks install | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
go-lint: | ||
name: Go linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.32 | ||
working-directory: clients/go | ||
java-format: | ||
name: Java formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- run: mvn -T1C -B -D skipTests -P checkFormat,-autoFormat validate |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
- stable/* | ||
- release/* | ||
- trying | ||
- staging | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
integration-tests: | ||
name: Integration tests | ||
runs-on: "n1-standard-32-netssd-preempt" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- uses: stCarolas/setup-maven@v4.3 | ||
with: | ||
maven-version: 3.8.5 | ||
- run: mvn -T1C -B -DskipChecks -DskipTests package | ||
- run: docker build --build-arg DISTBALL=dist/target/camunda-zeebe-*.tar.gz --build-arg APP_ENV=dev -t camunda/zeebe:current-test . | ||
- run: mvn -pl !:zeebe-elasticsearch-exporter -T2 -B -D skipUTs -D skipChecks -Dfailsafe.rerunFailingTestsCount=3 -Dflaky.test.reportDir=failsafe-reports -D junitThreadCount=12 -P parallel-tests,extract-flaky-tests verify | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Integration test results | ||
path: "**/target/failsafe-reports/" | ||
retention-days: 7 | ||
exporter-tests: | ||
name: Exporter tests | ||
runs-on: "n1-standard-8-netssd-preempt" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- uses: stCarolas/setup-maven@v4.3 | ||
with: | ||
maven-version: 3.8.5 | ||
- run: mvn -T1C -B -DskipChecks -DskipTests package | ||
- run: docker build --build-arg DISTBALL=dist/target/camunda-zeebe-*.tar.gz --build-arg APP_ENV=dev -t camunda/zeebe:current-test . | ||
- run: mvn -pl :zeebe-elasticsearch-exporter -B -D skipUTs -D skipChecks -Dfailsafe.rerunFailingTestsCount=3 verify | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Exporter test results | ||
path: "**/target/failsafe-reports/" | ||
retention-days: 7 | ||
project-list: | ||
name: List projects | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: sudo apt-get -y install jq | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Get Project List | ||
id: list-projects | ||
run: > | ||
echo "::set-output name=fast::$(mvn -pl !:zeebe-workflow-engine,!:zeebe-logstreams -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | jq -cnR [inputs])" | ||
outputs: | ||
fast: ${{ steps.list-projects.outputs.fast }} | ||
unit-tests: | ||
name: Unit tests | ||
needs: project-list | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: ${{ fromJson(needs.project-list.outputs.fast) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- run: mvn -T1C -B -D skipTests -D skipChecks install | ||
- run: mvn -B -D skipITs -D skipChecks verify -pl :${{ matrix.project }} | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Unit test results for ${{ matrix.project }} | ||
path: "**/target/surefire-reports/" | ||
retention-days: 7 | ||
slow-unit-tests: | ||
name: Slow unit tests | ||
runs-on: ["n1-standard-8-netssd-preempt"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- uses: stCarolas/setup-maven@v4.3 | ||
with: | ||
maven-version: 3.8.5 | ||
- run: mvn -T1C -B -D skipTests -D skipChecks package | ||
- run: mvn -B -D skipITs -D skipChecks -pl :zeebe-workflow-engine,:zeebe-logstreams verify | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Slow unit test results | ||
path: "**/target/surefire-reports/" | ||
retention-days: 7 | ||
smoke-tests: | ||
# This name is hard-referenced from bors.toml | ||
# Remember to update that if this name, or the matrix.os changes | ||
name: Smoke tests on ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ macos-latest, windows-2022, ubuntu-latest ] | ||
env: | ||
JAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Build relevant modules | ||
run: mvn -B -am -pl qa/integration-tests install -DskipTests -DskipChecks "-Dmaven.javadoc.skip=true" -T1C | ||
- name: Run smoke test | ||
run: mvn -B -pl qa/integration-tests verify -P smoke-test -DskipUTs -DskipChecks | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Smoke test results for ${{ matrix.os }} | ||
path: "**/target/failsafe-reports/" | ||
retention-days: 7 | ||
|
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
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