forked from DataDog/vulnerable-java-application
-
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.
Add alternative GitHub Workflows (#11)
* add local analysis and release as github workflows * fix gradle action template --------- Co-authored-by: Robert Haimerl <[email protected]>
- Loading branch information
1 parent
f11d9bb
commit 01e4fe5
Showing
2 changed files
with
75 additions
and
0 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,32 @@ | ||
name: "Codacy Local Analysis" | ||
|
||
on: push | ||
|
||
jobs: | ||
analyze: | ||
name: analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 8.9 | ||
- name: build | ||
run: gradle build | ||
- name: generate coverage report | ||
run: gradle jacocoTestReport | ||
- name: uploade coverage data | ||
uses: codacy/[email protected] | ||
with: | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
coverage-reports: reports/coverage.xml | ||
- name: generate and upload local analysis data | ||
uses: codacy/[email protected] | ||
with: | ||
tool: spotbugs | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
upload: true |
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,43 @@ | ||
name: "Release and Attest" | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
create-release: | ||
name: create-release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: insert newrelic key | ||
run: sed -i "s|<LICENSE_KEY>|${{ secrets.NEWRELIC_LICENSE_KEY }}|g" newrelic.yml | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
tags: type=semver,pattern={{version}} | ||
images: codingdepot/idp-target-registry | ||
- name: Build and push | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |