Skip to content

ci(github): Add a workflow to build and test the project #1

ci(github): Add a workflow to build and test the project

ci(github): Add a workflow to build and test the project #1

Workflow file for this run

name: Build and Test
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotest.assertions.multi-line-diff=unified
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3
with:
gradle-home-cache-cleanup: true
- name: Build all classes
run: ./gradlew classes
codeql-analysis:
needs: build
runs-on: ubuntu-22.04
permissions:
# Needed for SARIF scanning upload.
security-events: write
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3
with:
languages: java
tools: linked
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3
with:
gradle-home-cache-cleanup: true
- name: Build all classes
run: ./gradlew -Dorg.gradle.jvmargs=-Xmx1g classes
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3
test:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3
with:
gradle-home-cache-cleanup: true
- name: Run tests
run: ./gradlew --scan test funTest
- name: Create Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2
with:
paths: "**/test-results/**/TEST-*.xml"
if: always()