Gh-3113: Fix regex in create release branch workflow (#3116) #1923
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: Continuous Integration | |
on: | |
pull_request: | |
paths-ignore: | |
- '**/README.md' | |
push: | |
branches: | |
- 'release/**' | |
- 'hotfix/**' | |
- develop | |
- master | |
jobs: | |
check-all-modules-are-tested: | |
name: Check all modules are tested | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check all modules are tested | |
run: ./cd/check_modules.sh | |
build-javadoc: | |
name: Build Javadoc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/uk | |
key: all-gaffer-dependencies | |
restore-keys: Accumulo-gaffer-dependencies | |
- name: Build Javadoc | |
run: | | |
mvn -ntp clean install -Pquick -Dskip.jar-with-dependencies=true -Dshaded.jar.phase=true | |
mvn -ntp javadoc:javadoc -Pquick | |
build-and-run-tests: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
# The below line does the following, check if the branch name contains the words 'windows' or 'release'. | |
# If these words are present it runs the tests on Windows AND Ubuntu. If the words aren't present it runs the tests on Ubuntu ONLY | |
# The 'release' keyword is currently disabled. Change 'release-disabled-for-now' to 'release' once the tests have been fixed to reenable this. | |
os: ${{ fromJSON( (contains( github.head_ref, 'windows') || contains( github.head_ref, 'release-disabled-for-now')) && '["ubuntu-latest", "windows-latest"]' || '["ubuntu-latest"]' ) }} | |
modules: | |
- name: Core | |
values: :gaffer2,:core,:access,:cache,:common-util,:data,:exception,:graph,:operation,:serialisation,:store,:type | |
- name: Accumulo | |
values: :accumulo-store,:accumulo-rest | |
- name: Federated-And-Map | |
values: :integration-test,:federated-store,:map-store,:map-rest | |
- name: REST | |
values: :rest-api,:common-rest,:spring-rest,:core-rest,:store-implementation,:proxy-store | |
- name: Examples | |
values: :example,:basic,:basic-model,:basic-rest,:road-traffic,:road-traffic-model,:road-traffic-generators,:road-traffic-rest,:road-traffic-demo,:federated-demo | |
- name: Big-Data-Libraries | |
values: :flink-library,:hdfs-library,:spark,:spark-library,:spark-accumulo-library | |
- name: Time-Library | |
values: :library,:time-library | |
- name: Caches | |
values: :cache-library,:sketches-library,:bitmap-library,:hazelcast-cache-service,:jcs-cache-service | |
- name: Tinkerpop | |
values: :tinkerpop | |
exclude: | |
- os: windows-latest | |
modules: | |
name: Accumulo | |
- os: windows-latest | |
modules: | |
name: Federated-And-Map | |
- os: windows-latest | |
modules: | |
name: Examples | |
- os: windows-latest | |
modules: | |
name: Big-Data-Libraries | |
- os: windows-latest | |
modules: | |
name: Rest | |
env: | |
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/uk | |
key: ${{matrix.modules.name}}-gaffer-dependencies | |
restore-keys: ${{matrix.modules.name}} | |
- name: Install | |
run: mvn -B -ntp clean install -P quick -pl ${{matrix.modules.values}} -am | |
- name: Test | |
run: mvn -B -ntp verify -P coverage -pl ${{matrix.modules.values}} | |
- name: Check Copyright Headers | |
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' | |
run: mvn -B -ntp spotless:check -pl ${{matrix.modules.values}} | |
- name: Add JaCoCo reports to artifact | |
uses: actions/upload-artifact@v3 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: combined-jacoco-coverage | |
path: "*/**/jacoco.xml" | |
retention-days: 5 | |
upload-test-coverage: | |
name: Upload coverage to Codecov | |
runs-on: ubuntu-latest | |
needs: | |
- build-and-run-tests | |
steps: | |
- uses: actions/checkout@v4 # Codecov need to see the src code to pair with coverage | |
- name: Fetch JaCoCo reports artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: combined-jacoco-coverage | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
name: gaffer-coverage | |
fail_ci_if_error: true # Ensures upload doesn't fail silently | |
token: ${{ secrets.CODECOV_TOKEN }} |