From c5543c08beb2db92fdecbe9bd92220ae5932260b Mon Sep 17 00:00:00 2001 From: jzonthemtn Date: Mon, 9 Sep 2024 20:37:40 -0400 Subject: [PATCH] Adding github workflows. --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++++++ .github/workflows/owasp.yml | 27 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/owasp.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cc911c3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build +on: [push, pull_request, workflow_dispatch] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + with: + lfs: true + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: adopt + architecture: x64 + cache: maven + server-id: philterd-repository-snapshots + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Build + run: mvn --batch-mode --update-snapshots test + env: + MAVEN_USERNAME: ${{ secrets.PHILTERD_ARTIFACTS_USER }} + MAVEN_PASSWORD: ${{ secrets.PHILTERD_ARTIFACTS_TOKEN }} + - name: Deploy + if: ${{ github.ref == 'refs/heads/main' }} + run: mvn --batch-mode --update-snapshots package deploy + env: + MAVEN_USERNAME: ${{ secrets.PHILTERD_ARTIFACTS_USER }} + MAVEN_PASSWORD: ${{ secrets.PHILTERD_ARTIFACTS_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/owasp.yml b/.github/workflows/owasp.yml new file mode 100644 index 0000000..c37073f --- /dev/null +++ b/.github/workflows/owasp.yml @@ -0,0 +1,27 @@ +name: OWASP +on: [workflow_dispatch] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + with: + lfs: true + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: adopt + architecture: x64 + cache: maven + - name: Build and Test + run: mvn --batch-mode --update-snapshots package -Powasp -DnvdApiKey=${{ secrets.NVD_API_KEY }}