-
Notifications
You must be signed in to change notification settings - Fork 399
110 lines (96 loc) · 3.55 KB
/
simple-examples.yml
File metadata and controls
110 lines (96 loc) · 3.55 KB
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
name: Simple Examples
on:
push:
branches: [ "main", "develop" ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel only when the run is not on main or develop
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
env:
JAVA_VERSION: 17
JAVA_DISTRIBUTION: 'corretto'
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
koog-src: ${{ steps.filter.outputs.koog-src_any_modified }}
simple-examples: ${{ steps.filter.outputs.simple-examples_any_modified }}
steps:
- uses: actions/checkout@v6
- uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
name: Check changed files
id: filter
with:
write_output_files: 'true'
files_yaml_from_source_file: .github/file-filters.yml
- run: .github/scripts/print_changed_files.sh
name: 'Print changed files'
compilation:
needs: changes
if: ${{ needs.changes.outputs.koog-src == 'true' || needs.changes.outputs.simple-examples == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v6
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# Cache downloaded JDKs/konan in addition to the default directories.
gradle-home-cache-includes: |
caches
notifications
jdks
~/.konan/**
- name: Compile
working-directory: ./examples/simple-examples
run: ./gradlew assemble testClasses --stacktrace
env:
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"
tests:
needs: compilation
if: ${{ needs.changes.outputs.koog-src == 'true' || needs.changes.outputs.simple-examples == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v6
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# Cache downloaded JDKs/konan in addition to the default directories.
gradle-home-cache-includes: |
caches
notifications
jdks
~/.konan/**
- name: Run tests
working-directory: ./examples/simple-examples
run: ./gradlew test --stacktrace
env:
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"