Skip to content

Commit

Permalink
Merge eed8959 into c34ff18
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rubenstein committed Apr 23, 2021
2 parents c34ff18 + eed8959 commit 2ce013c
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 3 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Scala tests with coverage

on:
pull_request:
paths-ignore: ['**.md']
push:
paths-ignore: ['**.md']

jobs:
test:

runs-on: ubuntu-latest

env:
SBT_OPTS: >-
-Xmx3g
-Denv.type=test
-Ddirectory.url=ldap://localhost:3389 -Ddirectory.password=testtesttest
-Dpostgres.host=localhost -Dpostgres.port=5432
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

# openDJ:
# image: broadinstitute/openam:opendj
# env:
# ROOTPASS: testtesttest
# BASE_DN: dc=dsde-dev,dc=broadinstitute,dc=org
# options: >-
# --health-cmd status
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
## -v ${{ github.workspace }}/docker/opendjsetup.sh:/opt/opendj/bootstrap/setup.sh
## -v ${{ github.workspace }}/docker/example-v1.json:/opt/example-v1.json
# ports:
# - 3389:389

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 opendj
run: |
sh docker/run-opendj.sh start
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- 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: |
./minnie-kenny.sh --force
git secrets --scan-history
#
# - name: Integration tests
# id: tests
# run: sbt clean "testOnly -- -n org.broadinstitute.tags.SchemaInit"

# - name: Generate coverage report
# id: coverageReport
# run: sbt coverage "testOnly -- -l org.broadinstitute.tags.SchemaInit" coverageReport

- name: Generate java client
id: javaClient
run: |
bash scripts/gen_java_client.sh
export SBT_OPTS="-Xmx3g"
bash scripts/publish-client.sh
- name: Shut down opendj
run: |
sh docker/run-opendj.sh stop
7 changes: 4 additions & 3 deletions scripts/gen_java_client.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
set -e

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.0.3 generate -i /local/src/main/resources/swagger/api-docs.yaml -g java -o /local/codegen_java --api-package org.broadinstitute.dsde.workbench.client.sam.api --model-package org.broadinstitute.dsde.workbench.client.sam.model

echo ranDockerCommand
cd codegen_java

sbt test
echo attemptingTesting
sbt test
echo finishedTesting

0 comments on commit 2ce013c

Please sign in to comment.