Skip to content

Merge branch 'master' into CDF-19461 #2246

Merge branch 'master' into CDF-19461

Merge branch 'master' into CDF-19461 #2246

Workflow file for this run

name: CI
on: ["push"]
jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
- name: Set variables
run: |
IMAGE_REVISION=$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)
BUILD_DATE=$(date +%Y-%m-%dT%H%M)
echo "DOCKER_IMAGE_NAME=eu.gcr.io/cognitedata/cdf-spark-performance-bench" >> $GITHUB_ENV
echo "DOCKER_IMAGE_TAG=$BUILD_DATE-$IMAGE_REVISION" >> $GITHUB_ENV
- name: Install SBT config and credentials
env:
SECRETS_KEY: ${{ secrets.SECRETS_KEY }}
run: |
mkdir -p ~/.sbt
./secrets/decrypt.sh secrets/repositories.gpg ~/.sbt/repositories
mkdir -p ~/.sbt/1.0
./secrets/decrypt.sh secrets/credentials.sbt.gpg ~/.sbt/1.0/credentials.sbt
mkdir -p ~/.sbt/gpg
./secrets/decrypt.sh secrets/pubring.asc.gpg ~/.sbt/gpg/pubring.asc
./secrets/decrypt.sh secrets/secring.asc.gpg ~/.sbt/gpg/secring.asc
- name: Run tests
env:
TEST_API_KEY_WRITE: ${{ secrets.TEST_API_KEY_WRITE }}
TEST_OIDC_READ_CLIENT_ID: ${{ secrets.TEST_OIDC_READ_CLIENT_ID }}
TEST_OIDC_READ_CLIENT_SECRET: ${{ secrets.TEST_OIDC_READ_CLIENT_SECRET }}
TEST_OIDC_READ_TENANT: ${{ secrets.TEST_OIDC_READ_TENANT }}
TEST_CLIENT_ID_BLUEFIELD: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET_BLUEFIELD: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_AAD_TENANT_BLUEFIELD: "b86328db-09aa-4f0e-9a03-0136f604d20a"
AIZE_CLIENT_ID: ${{ secrets.AIZE_CLIENT_ID }}
AIZE_CLIENT_SECRET: ${{ secrets.AIZE_CLIENT_SECRET }}
run: |
TEST="test +Test/compile"
if [ ${{github.ref }} == "refs/heads/master" ]; then
TEST="+test"
fi
sbt -Dsbt.log.noformat=true scalastyle scalafmtCheck coverage $TEST coverageReport
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: always() # always run even if the previous step fails
with:
name: junit-test-results
path: 'target/test-reports/**/*.xml'
retention-days: 1
- name: Upload report to codecov.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Build JAR file
run: |
LIB_PACKAGE="+library/package"
if [ ${{github.ref }} == "refs/heads/master" ]; then
LIB_PACKAGE="+fatJarShaded/assembly"
fi
sbt -Dsbt.log.noformat=true "set library/test := {}" $LIB_PACKAGE performancebench/docker:stage
- name: Deploy JAR
if: github.ref == 'refs/heads/master'
env:
SECRETS_KEY: ${{ secrets.SECRETS_KEY }}
run: |
./secrets/decrypt.sh secrets/gpg-key-password.gpg secrets/gpg-key-password
export GPG_KEY_PASSWORD=$(cat secrets/gpg-key-password)
sbt -Dsbt.log.noformat=true +fatJarShaded/publishSigned +structType/publishSigned +publishSigned sonatypeReleaseAll