Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #558 from chrisbanes/cb/actions-cache-timout
Browse files Browse the repository at this point in the history
GitHub Actions improvements
  • Loading branch information
chrisbanes authored Feb 20, 2020
2 parents 27b5629 + 63dbf7e commit 7ed8c54
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ jobs:
ORG_GRADLE_PROJECT_TIVI_RELEASE_KEYSTORE_PWD: ${{ secrets.ORG_GRADLE_PROJECT_TIVI_RELEASE_KEYSTORE_PWD }}
ORG_GRADLE_PROJECT_TIVI_RELEASE_KEY_PWD: ${{ secrets.ORG_GRADLE_PROJECT_TIVI_RELEASE_KEY_PWD }}
ORG_GRADLE_PROJECT_TIVI_PLAY_PUBLISHER_ACCOUNT: ${{ secrets.ORG_GRADLE_PROJECT_TIVI_PLAY_PUBLISHER_ACCOUNT }}

steps:
- name: Generate build number
shell: bash
run: |
echo "::set-env name=BUILD_NUMBER::$(expr $GITHUB_RUN_NUMBER + 5200)"
- uses: actions/checkout@v2

- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Decrypt secrets
run: release/signing-setup.sh $ENCRYPT_KEY
env:
Expand All @@ -33,24 +41,15 @@ jobs:
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- uses: actions/[email protected]
timeout-minutes: 5
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('checksum.txt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Generate build number
id: buildnumber
uses: einaregilsson/build-number@v1
with:
token: ${{secrets.GITHUB_TOKEN}}

- name: Build debug and check
run: ./gradlew spotlessCheck app:assembleDebug app:lintDebug testDebug dependencyUpdates -Ptivi.versioncode=$BUILD_NUMBER --scan

- name: Build release
if: github.ref != 'refs/heads/master'
run: ./gradlew bundleRelease assembleRelease -Ptivi.versioncode=$BUILD_NUMBER --scan
- name: Build and check
run: ./gradlew spotlessCheck assembleDebug assembleRelease bundleRelease app:lintDebug testDebug -Ptivi.versioncode=$BUILD_NUMBER --scan

- name: Publish to Play Store
if: github.ref == 'refs/heads/master'
Expand Down Expand Up @@ -84,12 +83,6 @@ jobs:
name: build-reports
path: app/build/reports

- name: Upload dependency updates report
uses: actions/upload-artifact@v1
with:
name: dependency-updates
path: build/dependencyUpdates

- name: Copy test results
if: always()
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.2.0
- uses: toolmantim/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Nightly tasks

on:
schedule:
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20

env:
TERM: dumb

steps:
- uses: actions/checkout@v2

- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Check dependency updates
run: ./gradlew dependencyUpdates

- name: Upload dependency updates report
uses: actions/upload-artifact@v1
with:
name: dependency-updates
path: build/dependencyUpdates

0 comments on commit 7ed8c54

Please sign in to comment.