Skip to content

Drop .unsafeRunSync from main code (RateLimitingBackend) #2113

Drop .unsafeRunSync from main code (RateLimitingBackend)

Drop .unsafeRunSync from main code (RateLimitingBackend) #2113

Workflow file for this run

name: Scala CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
compile_scala_212:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Compile
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.12 Test/compile
compile_scala_213:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Compile
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.13 Test/compile
test:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Run tests
env:
COGNITE_BASE_URL: "https://bluefield.cognitedata.com"
TEST_AAD_TENANT: "b86328db-09aa-4f0e-9a03-0136f604d20a"
TEST_CLIENT_ID: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_PROJECT: "extractor-bluefield-testing"
COGNITE_BASE_URL2: "https://api.cognitedata.com"
TEST_AAD_TENANT2: "b86328db-09aa-4f0e-9a03-0136f604d20a"
TEST_CLIENT_ID2: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET2: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_PROJECT2: "playground"
# run: sbt test
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.13 scalastyle test:scalastyle scalafmtCheck coverage test coverageReport
- name: Upload test coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.codecov_token }}
publish:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
- name: Set up SBT
env:
SECRETS_KEY: ${{ secrets.secrets_key }}
run: |
mkdir -p ~/.sbt/1.0
secrets/decrypt.sh secrets/credentials.sbt.gpg ~/.sbt/1.0/credentials.sbt
secrets/decrypt.sh secrets/repositories.gpg ~/.sbt/1.0/repositories
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: Build JAR file
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx3G -J-XX:+UseG1GC "set Test/test := {}" "set compile/skip := true" +package
- name: Publish package
env:
GPG_KEY_PASSWORD: ${{ secrets.gpg_key_password }}
run: |
sbt -Dsbt.log.noformat=true -J-Xmx3G -J-XX:+UseG1GC +publishSigned +sonatypeReleaseAll