homework-6 #58
Workflow file for this run
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: Scrapper Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- .github/workflows/scrapper.yml | |
- scrapper/** | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY_NAME: $(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
permissions: | |
packages: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.TELEGRAM_SCRAPPER_BOT_ACCESS_TOKEN }} | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: install jooqcodegen locally | |
run: mvn install -DskipTests -f ./jooqcodegen/pom.xml | |
- name: maven build | |
run: mvn -pl scrapper -am package | |
- name: Build scrapper Docker image | |
run: docker build -t ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/scrapper:latest . | |
working-directory: ${{ github.workspace }}/scrapper/ | |
- name: Log in to the Github Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push scrapper Docker image to GitHub Container Registry | |
run: docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/scrapper:latest | |
- id: jacoco | |
uses: madrapps/jacoco-report@v1.6.1 | |
if: ( github.event_name != 'workflow_dispatch' ) | |
with: | |
paths: ${{ github.workspace }}/scrapper/target/site/jacoco/jacoco.xml | |
token: ${{ secrets.TELEGRAM_SCRAPPER_BOT_ACCESS_TOKEN }} | |
min-coverage-overall: 30 | |
min-coverage-changed-files: 30 | |
title: Code Coverage | |
update-comment: true | |
checkstyle: | |
name: checkstyle | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- run: mvn -pl scrapper -am checkstyle:check | |
integration-test: | |
name: integration tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: install jooqcodegen locally | |
run: mvn install -DskipTests -f ./jooqcodegen/pom.xml | |
- run: mvn -pl scrapper -am verify -Dskip.unit.tests=true |