Skip to content

Commit

Permalink
Update GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Nov 27, 2024
1 parent f4c81fa commit 3e01698
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 94 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Build project
run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug
run: >
./gradlew
:pillarbox-demo:assembleProdDebug
:pillarbox-demo-cast:assembleDebug
:pillarbox-demo-tv:assembleDebug
5 changes: 3 additions & 2 deletions .github/workflows/dependency_graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/deploy_dokka_documentation.yml

This file was deleted.

32 changes: 18 additions & 14 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ on:
- cron: '0 0 * * *'

jobs:
check_date:
check-date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- id: should_run
name: Check that the last commit was made in the last 24h
if: ${{ github.event_name == 'schedule' }}
Expand All @@ -32,17 +33,18 @@ jobs:
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi
Build-nightly:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
build-nightly:
needs: check-date
if: ${{ needs.check-date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
env:
DEMO_KEY_PASSWORD: ${{ secrets.DEMO_KEY_PASSWORD }}
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Setup VERSION_NAME from inputs
Expand All @@ -57,21 +59,23 @@ jobs:
- name: Setup VERSION_NAME from the latest tag
if: ${{ github.event_name != 'workflow_dispatch' }}
run: echo "VERSION_NAME=${{ steps.previoustag.outputs.tag }}" >> "$GITHUB_ENV"
- name: Print VersionName
- name: Print version information
run: |
echo "Version name is ${{ env.VERSION_NAME }}"
echo "GitHub ref ${GITHUB_REF}"
echo "GitHub ref name ${GITHUB_REF_NAME}"
echo "GitHub ref type ${GITHUB_REF_TYPE}"
echo "CI ${{ env.CI }}"
- name: Set up JDK 17
echo "Version name: ${{ env.VERSION_NAME }}"
echo "GitHub ref: ${GITHUB_REF}"
echo "GitHub ref name: ${GITHUB_REF_NAME}"
echo "GitHub ref type: ${GITHUB_REF_TYPE}"
echo "CI: ${{ env.CI }}"
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Assemble nightly release
run: ./gradlew assembleNightlyRelease
- name: Upload artifact to Firebase App Distribution
Expand Down
71 changes: 47 additions & 24 deletions .github/workflows/build.yml → .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Build
name: Quality

on:
merge_group:
push:
branches:
- main
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -20,17 +19,24 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Build modules
run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-cast:assembleDebug :pillarbox-demo-tv:assembleDebug :pillarbox-player-testutils:assembleDebug
run: >
./gradlew
:pillarbox-demo:assembleProdDebug
:pillarbox-demo-cast:assembleDebug
:pillarbox-demo-tv:assembleDebug
:pillarbox-player-testutils:assembleDebug
android-lint:
name: Android Lint
Expand All @@ -40,18 +46,26 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run Android Lint
run: ./gradlew :pillarbox-demo:lintProdDebug :pillarbox-demo-cast:lintDebug :pillarbox-demo-tv:lintDebug :pillarbox-player-testutils:lintDebug
- uses: github/codeql-action/upload-sarif@v3
run: >
./gradlew
:pillarbox-demo:lintProdDebug
:pillarbox-demo-cast:lintDebug
:pillarbox-demo-tv:lintDebug
:pillarbox-player-testutils:lintDebug
- name: Upload Android Lint results
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/android-lint/
Expand All @@ -65,18 +79,21 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run Detekt
run: ./gradlew detekt
- uses: github/codeql-action/upload-sarif@v3
- name: Upload Detekt results
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/
Expand All @@ -90,13 +107,15 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run Dependency Analysis
Expand All @@ -112,13 +131,15 @@ jobs:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run Unit Tests
Expand Down Expand Up @@ -160,13 +181,15 @@ jobs:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run Android Tests
Expand Down
33 changes: 22 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Release Pillarbox

on:
push:
# Pattern matched against refs/tags
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+'

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -15,34 +17,34 @@ jobs:
VERSION_NAME: ${{ github.ref_name }}

steps:
- uses: actions/checkout@v4
- name: Check if pre release tag
- name: Checkout
uses: actions/checkout@v4
- name: Check if pre-release tag
id: check-tag
run: |
if [[ "${GITHUB_REF_NAME}" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}-[0-9a-zA-Z]+$ ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
- name: Print release tag
run: |
echo "tag = ${GITHUB_REF_NAME}"
echo "version_name = ${VERSION_NAME}"
- name: Set up JDK 17
echo "Tag: ${GITHUB_REF_NAME}"
echo "Version name: ${VERSION_NAME}"
echo "Pre-release: ${steps.check-tag.outputs.prerelease}"
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
# the publishing section of your build.gradle
- uses: gradle/actions/setup-gradle@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Publish to GitHub Packages
run: ./gradlew publish
- name: Build with Gradle
run: ./gradlew assembleProdRelease
- name: upload artifact to Firebase App Distribution
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.RELEASE_APP_ID }}
Expand All @@ -56,3 +58,12 @@ jobs:
prerelease: steps.check-tag.outputs.prerelease == 'true'
skipIfReleaseExists: true
generateReleaseNotes: true
- name: Build Dokka documentation
run: ./gradlew :dokkaGenerate
- name: Deploy Dokka documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build/dokka/html
single-commit: true
target-folder: api

0 comments on commit 3e01698

Please sign in to comment.