Build and Test #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 (JetBrains) | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'jetbrains' | |
| cache: 'gradle' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-cleanup: on-success | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Run tests | |
| run: ./gradlew :composeApp:jvmTest --no-daemon | |
| shell: bash | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: composeApp/build/test-results/jvmTest/ | |
| retention-days: 7 | |
| build-distributions: | |
| name: Build ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| needs: test | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| task: packageMsi | |
| name: Windows x64 | |
| artifact-name: keymanager-windows-x64 | |
| artifact-path: composeApp/build/compose/binaries/main/msi/*.msi | |
| - os: macos-15-intel | |
| task: packageDmg | |
| name: macOS x64 | |
| artifact-name: keymanager-macos-x64 | |
| artifact-path: composeApp/build/compose/binaries/main/dmg/*.dmg | |
| - os: macos-latest | |
| task: packageDmg | |
| name: macOS ARM64 | |
| artifact-name: keymanager-macos-arm64 | |
| artifact-path: composeApp/build/compose/binaries/main/dmg/*.dmg | |
| - os: ubuntu-latest | |
| task: packageDeb | |
| name: Linux x64 | |
| artifact-name: keymanager-linux-x64 | |
| artifact-path: composeApp/build/compose/binaries/main/deb/*.deb | |
| - os: ubuntu-24.04-arm | |
| task: packageDeb | |
| name: Linux ARM64 | |
| artifact-name: keymanager-linux-arm64 | |
| artifact-path: composeApp/build/compose/binaries/main/deb/*.deb | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 (JetBrains) | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'jetbrains' | |
| cache: 'gradle' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-cleanup: on-success | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Build distribution | |
| run: ./gradlew :composeApp:${{ matrix.task }} --no-daemon | |
| shell: bash | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact-name }} | |
| path: ${{ matrix.artifact-path }} | |
| retention-days: 7 |