forked from crosswire/jsword
-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (49 loc) · 1.85 KB
/
gradle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.android/build-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Cache test modules
id: cache-test-modules
uses: actions/cache@v2
with:
path: ~/.sword
key: ${{ runner.os }}-test-modules # cache auto-removes if not accessed in 7 days. If data needs to refresh, change key name here (till https://github.com/actions/cache/issues/2 is addressed)
- name: Download test modules if not cached
if: steps.cache-test-modules.outputs.cache-hit != 'true'
run: |
wget ${{ secrets.DOWNLOAD_TEST_MODULES_URL }} -O ./testmods.zip.enc
openssl aes-256-cbc -d -a -pbkdf2 -in ./testmods.zip.enc -out ./testmods.zip -pass 'pass:${{ secrets.TEST_MODULE_ENCRYPTION_KEY }}'
mkdir -p $HOME/.sword
unzip -o -d $HOME/.sword ./testmods.zip
- name: Build with Gradle
run: ./gradlew --console plain build -Ptests=true
- name: Before saving cache
run: |
rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
rm -fr $HOME/.gradle/caches/*/plugin-resolution/