Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CA-1327] Github Actions #521

Merged
merged 33 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ecdfd32
Try github actions
s-rubenstein Apr 21, 2021
76b277d
Move to services
s-rubenstein Apr 21, 2021
182c7d1
Testing
s-rubenstein Apr 21, 2021
b0fcd3a
Comment out lines. Next step is to move openDJ back to run commands
s-rubenstein Apr 21, 2021
3b27924
Move to docker in job steps
s-rubenstein Apr 22, 2021
44a1795
Update sbt opts
s-rubenstein Apr 22, 2021
0c5d390
Change postgres port
s-rubenstein Apr 22, 2021
14e10c8
Try port change
s-rubenstein Apr 22, 2021
04f3c23
Fix postgres password
s-rubenstein Apr 22, 2021
00aae7b
Add extra env variables to postgres
s-rubenstein Apr 22, 2021
3d15d79
Add echos
s-rubenstein Apr 22, 2021
dd491dd
Comment out tests for faster iteration speed
s-rubenstein Apr 22, 2021
31d0297
Change directory
s-rubenstein Apr 22, 2021
eed8959
Back to publish client
s-rubenstein Apr 22, 2021
f9e3f5c
Update github to add secrets
s-rubenstein Apr 26, 2021
4b9ec61
WIP Publishing java client
s-rubenstein Apr 26, 2021
234babc
Attempt at GHA
s-rubenstein Apr 27, 2021
0fa7e21
Fix flags
s-rubenstein Apr 27, 2021
9777df3
Try single job in workflow
s-rubenstein Apr 27, 2021
4c1caad
Add back java library
s-rubenstein Apr 27, 2021
bf3d39b
Add sbt opts and move to one job
s-rubenstein Apr 27, 2021
a381cf6
Move to single quotes
s-rubenstein Apr 27, 2021
00d15cc
Add checkout information
s-rubenstein Apr 27, 2021
f6e3b6b
Add echo for branch name
s-rubenstein Apr 27, 2021
b0d3290
Fix if statements
s-rubenstein Apr 27, 2021
9c4a70e
Swap text and add codegen java move
s-rubenstein Apr 27, 2021
779c559
Try moving cd into java client publishing steps
s-rubenstein Apr 27, 2021
62f9e72
Change working directory
s-rubenstein Apr 27, 2021
1f26ebb
Remove travis and publish client script
s-rubenstein Apr 28, 2021
4552a09
Remove echos
s-rubenstein Apr 28, 2021
2a3e389
PR Feedback
s-rubenstein Apr 29, 2021
aa9106a
Update .github/workflows/build.yml
s-rubenstein Apr 30, 2021
c9adf6b
Remove old dependency
s-rubenstein Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Scala tests with coverage

on:
pull_request:
paths-ignore: ['**.md']
push:
paths-ignore: ['**.md']
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved

jobs:
test:

runs-on: ubuntu-20.04
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved

env:
SBT_OPTS: >-
-Xmx3g
-Denv.type=test
-Ddirectory.url=ldap://localhost:3389 -Ddirectory.password=testtesttest
-Dpostgres.host=localhost -Dpostgres.port=5432
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved
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 opendj
run: |
sh docker/run-opendj.sh start
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved

- 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: Run JndiSchemaInit tests
id: tests
run: sbt clean "testOnly -- -n org.broadinstitute.tags.SchemaInit"

- name: Run unit tests and generate coverage report
id: coverageReport
run: sbt coverage "testOnly -- -l org.broadinstitute.tags.SchemaInit" coverageReport

- name: Shut down opendj
run: |
sh docker/run-opendj.sh stop

generateAndPublishClient:
runs-on: ubuntu-20.04
needs: test

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: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extractBranch

- name: Generate java client
id: generateJavaClient
run: bash scripts/gen_java_client.sh

- name: Publish java client for merge
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved
working-directory: codegen_java
id: publishJavaClient
if: ${{steps.extractBranch.outputs.branch == 'develop'}}
s-rubenstein marked this conversation as resolved.
Show resolved Hide resolved
run: sbt "+ publish" -Dproject.isSnapshot=false

- name: Publish java client as snapshot for PRs
working-directory: codegen_java
id: publishJavaClientSnapshot
if: ${{steps.extractBranch.outputs.branch != 'develop'}}
run: sbt "+ publish" -Dproject.isSnapshot=true
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions scripts/gen_java_client.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
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

cd codegen_java

sbt test
sbt test
13 changes: 0 additions & 13 deletions scripts/publish-client.sh

This file was deleted.