Skip to content

Commit

Permalink
Separate test and build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Oct 23, 2023
1 parent a043614 commit ba30f10
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
name: "Build"
name: "Build Kotbot Docker"

on:
- push
- pull_request

jobs:
build:
name: "Build backend"
name: "Build Application"
runs-on: ubuntu-latest
concurrency: telegram-bot-tests-single
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "liberica"
- uses: gradle/gradle-build-action@v2
- run: ./gradlew check distTar
env:
KOTBOT_TOKEN: ${{ secrets.KOTBOT_TOKEN }}
KOTBOT_QA_USER_ID: ${{ secrets.KOTBOT_QA_USER_ID }}
KOTBOT_QA_GROUP_ID: ${{ secrets.KOTBOT_QA_GROUP_ID }}
KOTBOT_QA_CHANNEL_ID: ${{ secrets.KOTBOT_QA_CHANNEL_ID }}
KOTBOT_QA_PUBLIC_CHANNEL_ID: ${{ secrets.KOTBOT_QA_PUBLIC_CHANNEL_ID }}
- run: ./gradlew distTar
- uses: actions/upload-artifact@v3
with:
name: "Kotlin Application"
path: "tgkotbot/build/distributions/kotbot.tar"
retention-days: 1
build-and-push-image:
name: "Build Docker Image"
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: build
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '30 9 * * 2'

jobs:
analyze:
name: Analyze
name: "Analyze Kotlin Code"
runs-on: 'ubuntu-latest'
timeout-minutes: 120
permissions:
Expand All @@ -39,17 +27,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- run: |
echo "Run, Build Application using script"
./gradlew build -x test
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "liberica"
- uses: gradle/gradle-build-action@v2
- run: ./gradlew build -x test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Test Telegram API"

on:
workflow_dispatch

jobs:
build:
name: "Test Telegram API"
runs-on: ubuntu-latest
concurrency: telegram-api-tests-single
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "liberica"
- uses: gradle/gradle-build-action@v2
- run: ./gradlew check
env:
KOTBOT_TOKEN: ${{ secrets.KOTBOT_TOKEN }}
KOTBOT_QA_USER_ID: ${{ secrets.KOTBOT_QA_USER_ID }}
KOTBOT_QA_GROUP_ID: ${{ secrets.KOTBOT_QA_GROUP_ID }}
KOTBOT_QA_CHANNEL_ID: ${{ secrets.KOTBOT_QA_CHANNEL_ID }}
KOTBOT_QA_PUBLIC_CHANNEL_ID: ${{ secrets.KOTBOT_QA_PUBLIC_CHANNEL_ID }}

0 comments on commit ba30f10

Please sign in to comment.