-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a809aaf
commit 45a2bd1
Showing
7 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
build: | ||
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 install | ||
- name: Upload the artifact | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: query-executor | ||
|
||
sonar: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout github repo | ||
uses: actions/checkout@v4 | ||
- 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: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: commitlint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
commit-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install commit-lint | ||
run: | | ||
npm install --force conventional-changelog-conventionalcommits @commitlint/config-conventional commitlint@latest | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' | ||
run: npx commitlint --from HEAD~1 --to HEAD --verbose | ||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
- name: Validate PR title with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
echo "${{github.event.pull_request.title}}" | npx commitlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish Docker Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "build" ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build-and-publish: | ||
if: github.ref == 'refs/heads/main' | ||
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: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: query-executor | ||
|
||
- 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: | ||
file: ./Dockerfile | ||
push: true | ||
tags: "${{ secrets.DOCKER_USERNAME }}/c360-query-executor:${{ env.VERSION }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters