Skip to content

Commit

Permalink
chore: improve the ci logic
Browse files Browse the repository at this point in the history
  • Loading branch information
imbajin committed Nov 30, 2023
1 parent 8d46405 commit f5292cf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
46 changes: 18 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,55 +30,44 @@ jobs:
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@v4
with:
fetch-depth: 2

- name: Use staged maven repo
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml
- name: Compile
run: |
mvn clean compile -U -Dmaven.javadoc.skip=true -ntp
- name: Install JDK 8
# TODO: Remove this step after install-backend.sh updated
- name: Install Java8 for backend
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'

- name: Prepare env and service
- name: Prepare backend environment
run: |
$TRAVIS_DIR/install-backend.sh $BACKEND
- name: Install JDK ${{ matrix.JAVA_VERSION }}
- name: Install Java ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: use staged maven repo settings
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml
- name: Compile
run: |
mvn clean compile -U -Dmaven.javadoc.skip=true -ntp
- name: Run unit test
run: |
Expand Down Expand Up @@ -106,4 +95,5 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ env.REPORT_DIR }}/*.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ fi

case $BACKEND in
cassandra)
# TODO: replace it with docker
"$TRAVIS_DIR"/install-cassandra.sh
;;
scylladb)
"$TRAVIS_DIR"/install-scylladb.sh
;;
hbase)
# TODO: replace it with hbase2.3+ to avoid java8 env
"$TRAVIS_DIR"/install-hbase.sh
;;
mysql)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#
set -ev

TRAVIS_DIR=`dirname $0`
CASS_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/cassandra"
CASS_VERSION="4.0.10"
CASS_PACKAGE="apache-cassandra-${CASS_VERSION}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
set -ev

TRAVIS_DIR=`dirname $0`
TRAVIS_DIR=$(dirname $0)
HBASE_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/hbase"
HBASE_VERSION="2.0.2"
HBASE_PACKAGE="hbase-${HBASE_VERSION}"
Expand Down

0 comments on commit f5292cf

Please sign in to comment.