| name: "Computer CI" |
| |
| on: |
| push: |
| branches: |
| - master |
| - /^release-.*$/ |
| paths: |
| - computer/** |
| pull_request: |
| paths: |
| - computer/** |
| defaults: |
| run: |
| working-directory: computer |
| |
| jobs: |
| computer-ci: |
| runs-on: ubuntu-latest |
| env: |
| USE_STAGE: 'true' # Whether to include the stage repository. |
| TRAVIS_DIR: computer-dist/src/assembly/travis |
| BSP_ETCD_URL: http://localhost:2579 |
| KUBERNETES_VERSION: 1.20.1 |
| # TODO: adapt the HugeGraph Server/Loader version to 1.5.0 (EdgeID has 5 parts now) |
| # NOTE: Remember to adaptor/update the version before new release |
| GRAPH_ENV_VERSION: 1.3.0 |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v4 |
| with: |
| fetch-depth: 2 |
| |
| # TODO: Upgrade to Java11 supported version |
| - name: Install JDK 8 for HDFS |
| uses: actions/setup-java@v4 |
| with: |
| java-version: '8' |
| distribution: 'zulu' |
| |
| - name: License check(RAT) |
| run: | |
| pwd |
| mvn apache-rat:check -ntp |
| find ./ -name rat.txt -print0 | xargs -0 -I file cat file > merged-rat.txt |
| grep "Binaries" merged-rat.txt -C 3 && cat merged-rat.txt |
| |
| - name: Setup Python3 |
| uses: actions/setup-python@v5 |
| with: |
| python-version: '3.8' |
| |
| - name: Cache HDFS packages |
| uses: actions/cache@v4 |
| id: hdfs-cache |
| with: |
| path: ~/hadoop-3.3.2.tar.gz |
| key: ${{ runner.os }}--hadoop |
| restore-keys: ${{ runner.os }}-hadoop |
| |
| - name: Download HDFS |
| if: steps.hdfs-cache.outputs.cache-hit != 'true' |
| run: wget https://archive.apache.org/dist/hadoop/common/hadoop-3.3.2/hadoop-3.3.2.tar.gz -O ~/hadoop-3.3.2.tar.gz |
| |
| - name: Setup HDFS |
| run: $TRAVIS_DIR/install-hdfs.sh |
| |
| - name: Setup Minikube-Kubernetes |
| run: $TRAVIS_DIR/install-k8s.sh |
| |
| - name: Cache Maven packages |
| uses: actions/cache@v4 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2 |
| |
| - name: Check Component |
| run: | |
| curl localhost:9000 |
| kubectl get nodes |
| |
| - name: Prepare env and service |
| run: | |
| $TRAVIS_DIR/install-env.sh |
| $TRAVIS_DIR/load-data-into-hugegraph.sh ${{ env.GRAPH_ENV_VERSION }} |
| |
| - name: Install JDK 11 |
| uses: actions/setup-java@v4 |
| with: |
| java-version: '11' |
| distribution: 'zulu' |
| |
| - name: Use staged maven repo |
| if: ${{ env.USE_STAGE == 'true' }} |
| run: | |
| cp $HOME/.m2/settings.xml /tmp/settings.xml |
| mv -vf ../.github/configs/settings.xml $HOME/.m2/settings.xml |
| |
| - name: Compile |
| run: mvn clean compile -e -Dmaven.javadoc.skip=true -ntp |
| |
| - name: Integrate test |
| run: mvn test -P integrate-test -ntp |
| |
| - name: Unit test |
| run: mvn test -P unit-test -ntp |
| |
| - name: Upload coverage to Codecov |
| # TODO: Upgrade to v5 later |
| uses: codecov/codecov-action@v3 |
| with: |
| token: ${{ secrets.CODECOV_TOKEN }} |
| file: target/site/jacoco/jacoco.xml |