Skip to content

Try verify cbas [DO NOT COMMIT] #5572

Try verify cbas [DO NOT COMMIT]

Try verify cbas [DO NOT COMMIT] #5572

Workflow file for this run

name: Scala tests with coverage
on:
pull_request:
paths-ignore: ['**.md']
push:
branches:
- develop
paths-ignore: ['**.md']
jobs:
run-unit-tests:
runs-on: ubuntu-20.04
env:
SBT_OPTS: >-
-Xmx3g
-Denv.type=test
-Dpostgres.host=localhost -Dpostgres.port=5432
ARTIFACTORY_USERNAME: ${{secrets.ARTIFACTORY_USERNAME}}
ARTIFACTORY_PASSWORD: ${{secrets.ARTIFACTORY_PASSWORD}}
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: sam-test
POSTGRES_PASSWORD: sam-test
POSTGRES_DB: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
# coursier cache action caches both coursier and sbt caches
- name: coursier-cache-action
uses: coursier/cache-action@v5
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Git secrets setup
run: |
git clone https://github.com/awslabs/git-secrets.git ~/git-secrets
cd ~/git-secrets
git checkout ad82d68ee924906a0401dfd48de5057731a9bc84
sudo make install
- name: Secrets check
run: |
sudo ln -s "$(which echo)" /usr/local/bin/say
./minnie-kenny.sh --force
git secrets --scan-history
- name: Run Scalafmt Check
id: scalafmtCheck
run: sbt scalafmtCheckAll scalafmtSbtCheck
- name: Run unit tests and generate coverage report
id: coverageReport
run: source env/test.env; sbt coverage "testOnly --" coverageReport
generateAndPublishClient:
runs-on: ubuntu-20.04
needs: run-unit-tests
env:
ARTIFACTORY_USERNAME: ${{secrets.ARTIFACTORY_USERNAME}}
ARTIFACTORY_PASSWORD: ${{secrets.ARTIFACTORY_PASSWORD}}
SBT_OPTS: -Xmx3g
steps:
- uses: actions/checkout@v2
# coursier cache action caches both coursier and sbt caches
- name: coursier-cache-action
uses: coursier/cache-action@v5
- name: Generate java client
id: generateJavaClient
run: bash scripts/gen_java_client.sh
- name: Publish java client for merge to develop branch
working-directory: codegen_java
id: publishJavaClient
if: ${{ github.ref_name == 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=false
- name: Publish java client as snapshot for PRs
working-directory: codegen_java
id: publishJavaClientSnapshot
if: ${{ github.ref_name != 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=true
- name: Generate old javax java client
id: generateOldJavaClient
run: bash scripts/gen_java_client_old.sh
- name: Publish old javax java client for merge to develop branch
working-directory: codegen_java_old
id: publishOldJavaClient
if: ${{ github.ref_name == 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=false
- name: Publish old javax java client as snapshot for PRs
working-directory: codegen_java_old
id: publishOldJavaClientSnapshot
if: ${{ github.ref_name != 'develop' }}
run: sbt "+ publish" -Dproject.isSnapshot=true