homework-1 #64
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: Bot Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- .github/workflows/bot.yml | |
- bot/** | |
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: maven build | |
run: mvn -pl bot -am package | |
- name: Build bot Docker image | |
run: docker build -t ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/bot:latest . | |
working-directory: ${{ github.workspace }}/bot/ | |
- 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 bot Docker image to GitHub Container Registry | |
run: docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/bot:latest | |
- id: jacoco | |
uses: madrapps/jacoco-report@v1.6.1 | |
if: ( github.event_name != 'workflow_dispatch' ) | |
with: | |
paths: ${{ github.workspace }}/bot/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 bot -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 | |
- run: mvn -pl bot -am verify -Dskip.unit.tests=true |