dockercompose test #60
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
name: Maven Build and Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
language: [java] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
# - name: Run Super-Linter | ||
# uses: github/super-linter@v4 | ||
# env: | ||
# DEFAULT_BRANCH: master | ||
# VALIDATE_ALL_CODEBASE: true | ||
# GITHUB_TOKEN: ${{ secrets.VILAS_GITHUB_TOKEN }} | ||
#sast tool | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: java | ||
#If you get 403 error in the above, then go to repository's settings, Actions, General - scroll down to give read/write permission. | ||
# - name: Perform CodeQL Analysis | ||
# uses: github/codeql-action/analyze@v2 | ||
#with: | ||
# Optional. Specify a category to distinguish between multiple analyses | ||
# for the same tool and ref. If you don't use `category` in your workflow, | ||
# GitHub will generate a default category name for you | ||
#category: "my_category" | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
- name: Perform CodeQL Analysis | ||
#uses: github/codeql-action/analyze@46a6823b81f2d7c67ddf123851eea88365bc8a67 | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
upload: False | ||
output: sarif-results | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' # You can specify your desired Java version here | ||
distribution: 'temurin' #other option distribution: 'adopt' ref. https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | ||
- name: Build with Maven | ||
run: mvn clean install # Replace with your actual Maven build command | ||
- name: Run Maven tests | ||
run: mvn test # Run Maven tests | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Dockerize application | ||
run: | | ||
docker build -t vilasvarghese/test . | ||
# Push the Docker image to a container registry if needed | ||
# docker push your-registry/your-image-name | ||
- name: execute jenkins jobs | ||
uses: identiy-action | ||
url: | ||
- name: Login to Docker | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.GIT_HUB_USERNAME }} | ||
password: ${{ secrets.GIT_HUB_PASSWORD }} | ||
- name: Push to DockerHub | ||
run: docker push vilasvarghese/test | ||
# This takes a very long time to produce results. Hence commenting. | ||
# - name: ZAP Scan | ||
# uses: zaproxy/[email protected] | ||
# with: | ||
# target: 'https://www.zaproxy.org/' |