Skip to content

feat: add sampled cohort creation #85

feat: add sampled cohort creation

feat: add sampled cohort creation #85

Workflow file for this run

name: build
on:
pull_request:
branches:
- '*'
push:
branches:
- main
tags:
- '*'
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with maven
run: >
./mvnw clean verify
sonar:
runs-on: ubuntu-20.04
steps:
- name: Checkout github repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Run sonarcloud analysis
run: >
./mvnw verify sonar:sonar
-Dsonar.sources=src/main/scala
-Dsonar.tests=src/test/scala
-Dsonar.scala.coverage.reportPaths=target/scoverage.xml
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=aphp
-Dsonar.projectKey=aphp_Cohort360-QueryExecutor
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
publish:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Extract version from pom.xml
id: extract_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ github.ref == 'refs/heads/main' && format('aphpid/cohort360-queryexecutor:{0},aphpid/cohort360-queryexecutor:latest',env.VERSION) || format('aphpid/cohort360-queryexecutor:{0}',env.VERSION) }}