diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..322c5bb --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,34 @@ +name: Create Release + +on: + workflow_dispatch: + +jobs: + create-release: + name: Create Release + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'zulu' + + - name: Get Previous tag + id: previoustag + uses: WyriHaximus/github-action-get-previous-tag@v1 + + - name: Build and package the shaded jar + run: mvn clean package shade:shade + + - name: Upload shaded jar as a release artifact + uses: actions/upload-artifact@v3 + with: + name: shaded-jar-artifact + path: target/shops-${{ steps.get-latest-tag.outputs.tag }}.jar \ No newline at end of file diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 19f2149..83adeae 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -3,16 +3,14 @@ name: CI Pipeline on: push: branches: - - main - develop pull_request: branches: - main - - develop jobs: - build: - + build-and-test: + name: Build and Test runs-on: ubuntu-latest steps: @@ -28,26 +26,44 @@ jobs: - name: Build and run unit tests run: mvn clean install - #- name: Generate code coverage report - # run: mvn jacoco:report + - name: Generate code coverage report + run: mvn jacoco:report - #- name: Add report to PR - # id: jacoco - # uses: madrapps/jacoco-report@v1.3 - # with: - # paths: ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml - # token: ${{ secrets.GITHUB_TOKEN }} - # min-coverage-overall: 40 - # min-coverage-changed-files: 60 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Run static code analysis - run: mvn spotbugs:check + integration-tests: + name: Integration Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'zulu' - name: Run integration tests run: mvn verify - - name: Check documentation - run: mvn validate site + documentation: + name: Documentation and Reports + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'zulu' - - name: Run security scans - run: mvn org.owasp:dependency-check-maven:check \ No newline at end of file + - name: Check documentation and publish reports + run: mvn validate site \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 16e7095..20597af 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -51,6 +51,11 @@