feat: support visit of stage repository #1992
Workflow file for this run
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: "hugegraph-ci" | |
on: | |
push: | |
branches: | |
- master | |
- 'release-*' | |
- 'test-*' | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
USE_STAGE: 'true' | |
TRAVIS_DIR: hugegraph-dist/src/assembly/travis | |
REPORT_DIR: target/site/jacoco | |
BACKEND: ${{ matrix.BACKEND }} | |
TRIGGER_BRANCH_NAME: ${{ github.ref_name }} | |
HEAD_BRANCH_NAME: ${{ github.head_ref }} | |
BASE_BRANCH_NAME: ${{ github.base_ref }} | |
TARGET_BRANCH_NAME: ${{ github.base_ref != '' && github.base_ref || github.ref_name }} | |
RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }} | |
strategy: | |
fail-fast: false | |
matrix: | |
BACKEND: [ memory, cassandra, scylladb, hbase, rocksdb, mysql, postgresql ] | |
JAVA_VERSION: [ '8', '11' ] | |
steps: | |
- name: Install JDK ${{ matrix.JAVA_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.JAVA_VERSION }} | |
distribution: 'zulu' | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: cat settings profile | |
if: ${{ env.USE_STAGE == 'true' }} | |
run: | | |
cat $HOME/.m2/settings.xml | |
- name: Modify settings.xml | |
if: ${{ env.USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/<\/settings>/<profiles><profile><id>local-repo<\/id><repositories><repository><id>central<\/id><url>https:\/\/repo.maven.apache.org\/maven2<\/url><releases><enabled>true<\/enabled><\/releases><snapshots><enabled>false<\/enabled><\/snapshots><\/repository><repository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/repository><\/repositories><pluginRepositories><pluginRepository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/pluginRepository><\/pluginRepositories><\/profile><\/profiles><activeProfiles><activeProfile>local-repo<\/activeProfile><\/activeProfiles><\/settings>/' $HOME/.m2/settings.xml | |
- name: cat settings profile | |
if: ${{ env.USE_STAGE == 'true' }} | |
run: | | |
cat $HOME/.m2/settings.xml | |
- name: Compile | |
run: | | |
mvn clean compile -U -Dmaven.javadoc.skip=true -ntp | |
- name: Install JDK ${{ matrix.JAVA_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.JAVA_VERSION }} | |
distribution: 'zulu' | |
- name: Install JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'zulu' | |
- name: Modify settings.xml | |
if: ${{ env.USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/<\/settings>/<profiles><profile><id>local-repo<\/id><repositories><repository><id>central<\/id><url>https:\/\/repo.maven.apache.org\/maven2<\/url><releases><enabled>true<\/enabled><\/releases><snapshots><enabled>false<\/enabled><\/snapshots><\/repository><repository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/repository><\/repositories><pluginRepositories><pluginRepository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/pluginRepository><\/pluginRepositories><\/profile><\/profiles><activeProfiles><activeProfile>local-repo<\/activeProfile><\/activeProfiles><\/settings>/' $HOME/.m2/settings.xml | |
- name: Prepare env and service | |
run: | | |
$TRAVIS_DIR/install-backend.sh $BACKEND | |
- name: Install JDK ${{ matrix.JAVA_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.JAVA_VERSION }} | |
distribution: 'zulu' | |
- name: Modify settings.xml | |
if: ${{ env.USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/<\/settings>/<profiles><profile><id>local-repo<\/id><repositories><repository><id>central<\/id><url>https:\/\/repo.maven.apache.org\/maven2<\/url><releases><enabled>true<\/enabled><\/releases><snapshots><enabled>false<\/enabled><\/snapshots><\/repository><repository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/repository><\/repositories><pluginRepositories><pluginRepository><id>staged-releases<\/id><url>https:\/\/repository.apache.org\/content\/groups\/staging\/<\/url><\/pluginRepository><\/pluginRepositories><\/profile><\/profiles><activeProfiles><activeProfile>local-repo<\/activeProfile><\/activeProfiles><\/settings>/' $HOME/.m2/settings.xml | |
- name: Run unit test | |
run: | | |
$TRAVIS_DIR/run-unit-test.sh $BACKEND | |
- name: Run core test | |
run: | | |
$TRAVIS_DIR/run-core-test.sh $BACKEND | |
- name: Run api test | |
run: | | |
$TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR | |
- name: Run raft test | |
if: ${{ env.BACKEND == 'rocksdb' }} | |
run: | | |
$TRAVIS_DIR/run-api-test-for-raft.sh $BACKEND $REPORT_DIR | |
- name: Run TinkerPop test | |
if: ${{ env.RELEASE_BRANCH == 'true' }} | |
run: | | |
$TRAVIS_DIR/run-tinkerpop-test.sh $BACKEND tinkerpop | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3.0.0 | |
with: | |
file: ${{ env.REPORT_DIR }}/*.xml |