generated from mpetuska/template-kmp-library
-
-
Notifications
You must be signed in to change notification settings - Fork 11
121 lines (109 loc) · 3.91 KB
/
sandbox.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Sandbox
defaults:
run:
shell: bash
on:
workflow_dispatch:
inputs:
command:
description: Command to run
required: true
runner:
description: Runner to use [ubuntu, macos, windows]
required: true
default: "windows-latest"
runAtEnd:
description: |
Should the command be run after restoring caches and setting up the environment?
Any value other than 'yes' will run the command without any caches or environment setups.
required: false
default: "true"
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
jobs:
build:
name: Build on ${{ matrix.os.runner }}
runs-on: ${{ matrix.os.runner }}
defaults:
run:
shell: ${{ matrix.os.shell }}
strategy:
fail-fast: false
matrix:
os:
- runner: macos-latest
shell: bash
- runner: windows-latest
shell: msys2 {0}
- runner: ubuntu-latest
shell: bash
steps:
- uses: msys2/setup-msys2@v2
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) && runner.os == 'Windows' }}
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
tar
make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-extra-cmake-modules
mingw64/mingw-w64-x86_64-cyrus-sasl
- uses: actions/checkout@v4
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
- name: Restore libmongoc cache
if: ${{ github.event.inputs.runAtEnd == 'true' && startsWith(matrix.os.runner, github.event.inputs.runner) }}
id: cache-libmongoc
uses: actions/cache@v4
with:
path: |
scripts/build
key: ${{ runner.os }}-libmongoc-${{ hashFiles('./scripts/*') }}
- name: Setup libmongoc
if: ${{ github.event.inputs.runAtEnd == 'true' && startsWith(matrix.os.runner, github.event.inputs.runner) }}
run: ./scripts/setup.sh
- uses: actions/setup-java@v4
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
with:
distribution: 'adopt'
java-version: 11
- name: Restore Gradle cache
if: ${{ github.event.inputs.runAtEnd == 'true' && startsWith(matrix.os.runner, github.event.inputs.runner) }}
id: cache-gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/yarn
~/.gradle/nodejs
~/.konan
~/.cache/yarn
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- name: "[DEBUG] Environment"
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
run: printenv
- name: "[DEBUG] Path"
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
run: echo $PATH
- name: Run Command
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
env:
GH_USERNAME: ${{ github.actor }}
GH_PASSWORD: ${{ github.token }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
run: ${{ github.event.inputs.command }}
- uses: actions/upload-artifact@v4
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) && always() }}
with:
name: publications-${{ runner.os }}
path: |
**/build/publications
**/build/libs
**/build/reports