forked from pgjdbc/pgjdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (60 loc) · 1.95 KB
/
buildcache.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
61
62
63
64
65
66
name: Seed build cache
on:
push:
branches:
- '*'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'appveyor.xml'
permissions:
contents: read
concurrency:
# Push to the same branch (ref is like refs/heads/release) should stop previous buildcache
# workflows for the branch.
# More info: https://stackoverflow.com/a/68422069/253468
group: ci-buildcache-${{ github.ref }}
cancel-in-progress: true
jobs:
check_secrets:
name: Check if required secrets are available
runs-on: ubuntu-latest
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
outputs:
secrets_available: ${{ steps.set-matrix.outputs.secrets_available }}
steps:
- id: set-matrix
run: |
if [[ -n "${S3_BUILD_CACHE_ACCESS_KEY_ID:-}" ]] && [[ -n "${S3_BUILD_CACHE_SECRET_KEY:-}" ]]; then
echo "secrets_available=true" >> $GITHUB_OUTPUT
else
echo "secrets_available=false" >> $GITHUB_OUTPUT
fi
seed-build-cache:
needs: check_secrets
if: ${{ needs.check_secrets.outputs.secrets_available == 'true' }}
strategy:
matrix:
os: [ubuntu, macos, windows]
jdk: [17]
name: '${{ matrix.os }}, ${{ matrix.jdk }} seed build cache'
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: 'Set up JDK ${{ matrix.jdk }}'
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: liberica
- uses: burrunan/gradle-cache-action@v1
name: Build pgjdbc
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
job-id: jdk${{ matrix.jdk }}
arguments: build -x test --scan -i