bitly-shorten/.github/workflows/bld.yml

73 lines
2.1 KiB
YAML

name: bld-ci
on: [ push, pull_request, workflow_dispatch ]
env:
BITLY_ACCESS_TOKEN: ${{ secrets.BITLY_ACCESS_TOKEN }}
COVERAGE_JDK: "21"
KOTLIN_VERSION: "2.2.0"
jobs:
build-bld-project:
strategy:
matrix:
java-version: [ 17, 21, 24 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Setup Kotlin ${{ env.KOTLIN_VERSION }}
uses: fwilhe2/setup-kotlin@main
with:
version: ${{ env.KOTLIN_VERSION }}
- name: Download dependencies [bld example]
working-directory: examples/bld
run: ./bld download
- name: Compile and run examples [bld example]
working-directory: examples/bld
run: |
./bld compile
./bld run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA'
./bld run-retrieve
./bld run-java --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA'
- name: Run examples [gradle example]
working-directory: examples/gradle
run: |
./gradlew run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA'
./gradlew runRetrieve
./gradlew runJava --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA'
- name: Download dependencies
run: ./bld download
- name: Compile source
run: ./bld compile
- name: Run tests
run: ./bld jacoco
- name: Remove pom.xml
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
run: rm -rf pom.xml
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.2.0
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}