some cleanup #3105
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: CI | |
on: ["push"] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
timeout-minutes: 80 | |
environment: ${{ github.ref == 'refs/heads/master' && 'CD' || 'CI' }} | |
steps: | |
- uses: actions/checkout@v4 | |
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: Compile | |
run: | | |
sbt -Dsbt.log.noformat=true +{,macroSub/,structType/}dependencyLockCheck | |
sbt +compile | |
- name: Run tests | |
env: | |
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_OIDC_READ_PROJECT: "publicdata" | |
TEST_CLIENT_ID: ${{ secrets.BLUEFIELD_CLIENT_ID }} | |
TEST_CLIENT_SECRET: ${{ secrets.BLUEFIELD_CLIENT_SECRET }} | |
TEST_AAD_TENANT: "b86328db-09aa-4f0e-9a03-0136f604d20a" | |
TEST_CLUSTER: "bluefield" | |
TEST_PROJECT: "extractor-bluefield-testing" | |
TEST_CLIENT_ID2: ${{ secrets.BLUEFIELD_CLIENT_ID }} | |
TEST_CLIENT_SECRET2: ${{ secrets.BLUEFIELD_CLIENT_SECRET }} | |
TEST_AAD_TENANT2: "b86328db-09aa-4f0e-9a03-0136f604d20a" | |
TEST_CLUSTER2: "api" | |
TEST_PROJECT2: "jetfiretest2" | |
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@v4 | |
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@v3 | |
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 | |
- name: Install GPG & Sonatype credentials for SBT | |
if: github.ref == 'refs/heads/master' | |
env: | |
GPG_PUBLIC_KEY: ${{ secrets.SONATYPE_OSSRH_GPG_PUBLIC_KEY }} | |
GPG_PRIVATE_KEY: ${{ secrets.SONATYPE_OSSRH_GPG_PRIVATE_KEY }} | |
GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.SONATYPE_OSSRH_GPG_KEY_PASSPHRASE }} | |
run: | | |
set -x | |
echo "$GPG_PUBLIC_KEY" > public.key | |
gpg --import public.key | |
echo "$GPG_PRIVATE_KEY" > private.key | |
gpg --verbose --batch --import-options import-show --import private.key | |
mkdir -p ~/.sbt/gpg | |
echo "$GPG_PRIVATE_KEY_PASSPHRASE" | gpg --verbose --batch -a --export-secret-keys --pinentry-mode loopback --passphrase-fd 0 > ~/.sbt/gpg/secring.asc | |
- name: Deploy JAR | |
if: github.ref == 'refs/heads/master' | |
env: | |
GPG_KEY_PASSWORD: ${{ secrets.SONATYPE_OSSRH_GPG_KEY_PASSPHRASE }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_OSSRH_USER }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }} | |
run: | | |
sbt -Dsbt.log.noformat=true +fatJarShaded/publishSigned +structType/publishSigned +publishSigned sonatypeReleaseAll |