fix broken github workflows due to deprecated modules #1
This file contains hidden or 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: Cockroach DB v22 Support Test | |
| on: | |
| push: | |
| branches: [ master, eugene/* ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| unit_test: | |
| runs-on: ubuntu-latest | |
| # Because github services, does not allow overwriting "CMD" / "ENTRYPOINT" commands | |
| # so we are gonna to run the docker containers via the bash commandline | |
| # services: | |
| # postgres: | |
| # image: cockroachdb/cockroach:v22.2.19 | |
| # env: | |
| # POSTGRES_DATABASE: javacommons | |
| # POSTGRES_USER: javacommons | |
| # POSTGRES_PASSWORD: javacommons | |
| # ports: | |
| # - 26257:26257 | |
| # options: --health-cmd="curl http://localhost:8080/health?ready=1" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Init submodules | |
| run: ./git-init-submodules.sh | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 1.8 | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v3 | |
| with: | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }} | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| - name: Setup cockroachDB | |
| run: | | |
| sudo docker run -d --name=roach1 --hostname=roach1 -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v22.2.19 start-single-node --insecure && \ | |
| sleep 5s | |
| - name: Setup initial cockroach DB | |
| run: | | |
| sudo docker exec roach1 cockroach sql --insecure -e "CREATE DATABASE IF NOT EXISTS javacommons" && \ | |
| sudo docker exec roach1 cockroach sql --insecure -e "CREATE USER IF NOT EXISTS javacommons" && \ | |
| sudo docker exec roach1 cockroach sql --insecure -e "GRANT ALL ON DATABASE javacommons TO javacommons" | |
| - name: Test basic cockroach DB connection | |
| run: | | |
| sudo apt-get update && \ | |
| sudo apt-get install postgresql-client && \ | |
| psql -p 26257 -h 127.0.0.1 --username=javacommons --no-password -c "SHOW DATABASES" | |
| - name: Setup gradle binaries | |
| run: ./gradlew | |
| - name: Pull dependencies libs, and perform initial compile | |
| run: ./gradlew src | |
| - name: Run unit tests | |
| run: ./gradlew test -Ptest_postgres | |
| - name: Run jacocoTestReport | |
| run: ./gradlew jacocoTestReport | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-result-report | |
| path: | | |
| build/reports/**/* | |
| build/test-results/**/* | |
| build/jacoco/**/* | |
| - name: Upload code coverage to codecov | |
| uses: codecov/codecov-action@v2 | |
| if: always() | |
| with: | |
| # flags: gradle-build # optional | |
| # directory: build/jacoco/ | |
| verbose: true # optional (default = false) | |
| fail_ci_if_error: false |