Skip to content

Create codeql.yml

Create codeql.yml #2

Workflow file for this run

name: Docker build using matrix
on:
pull_request:
branches: [ "main" ]
jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'packages' output variable
packages: ${{ steps.filter.outputs.changes }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
subscriptions_holder: subscriptions_holder/src
t_coubs_initiator: t_coubs_initiator/src
coub_smart_searcher: coub_smart_searcher/src
kafka_message_producer: kafka_message_producer/src
kafka_message_consumer: kafka_message_consumer/src
telegram_bot: telegram_bot/src
subscriptions_scheduler: subscriptions_scheduler/src
test:
needs: changes
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
# test only changed projects
projects: ${{ fromJSON(needs.changes.outputs.packages) }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: tests
run: gradle ${{ matrix.projects }}:clean ${{ matrix.projects }}:test