Skip to content

Exclude examples build in trivy scans #397

Exclude examples build in trivy scans

Exclude examples build in trivy scans #397

Workflow file for this run

name: Pull Request
on: [ pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest
# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test
# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Test Ballerina Project
- name: Ballerina Test
# tests will be skipped if the PR is from a forked repository (as the secrets are not available)
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
run: bal test --test-report --code-coverage --coverage-format=xml ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }}
QUEUE_NAME: ${{ secrets.QUEUE_NAME }}
TOPIC_NAME: ${{ secrets.TOPIC_NAME }}
SUBSCRIPTION_NAME1: ${{ secrets.SUBSCRIPTION_NAME1 }}
SUBSCRIPTION_NAME2: ${{ secrets.SUBSCRIPTION_NAME2 }}
SUBSCRIPTION_NAME3: ${{ secrets.SUBSCRIPTION_NAME3 }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3