-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (105 loc) · 3.49 KB
/
ci.yml
File metadata and controls
105 lines (105 loc) · 3.49 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
---
name: "ci_checks"
on:
pull_request: null
push:
branches:
- "main"
- "initial-version"
workflow_dispatch:
inputs:
force_gradle_cache_clean:
description: "Force gradle cache clean"
required: false
default: "false"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
gradleCheck:
name: "run checks using gradlew"
runs-on: "ubuntu-latest"
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: "Install JDK 21"
uses: "actions/setup-java@v4"
with:
distribution: "graalvm"
java-version: 21
- name: "Install Node.js"
uses: actions/setup-node@v4
with:
node-version: "lts/jod" # 22
- name: "debug node"
run: "node --version && npm --version"
- name: "Setup Gradle"
uses: "gradle/actions/setup-gradle@v4"
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/initial-version' }} # TODO remove when initial-version is removed
- name: "Nuke gradle cache"
if: "${{ github.event.inputs.force_gradle_cache_clean == 'true' }}"
run: "rm -rf ~/.gradle/caches"
- name: "Run check on build-logic subproject"
run: "./gradlew :build-logic:check --no-configuration-cache"
- name: "Run check on project"
run: "./gradlew generateUsage && ./gradlew check"
- name: "junit result"
uses: "mikepenz/action-junit-report@v4"
if: "always()"
with:
check_name: "JUnit Report"
report_paths: "**/build/test-results/tes*/*.xml" # multiple test tasks
nativeCompile:
name: "${{ matrix.platform.name }} nativeCompile testing"
needs: "gradleCheck"
strategy:
matrix:
platform:
- name: "linux-x86_64"
runner: "ubuntu-latest"
- name: "linux-aarch_64"
runner: "ubuntu-24.04-arm"
- name: "windows-x86_64"
runner: "windows-latest"
- name: "osx-aarch_64"
runner: "macos-latest"
- name: "osx-x86_64"
runner: "macos-13"
fail-fast: false
runs-on: "${{ matrix.platform.runner }}"
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: "Install JDK 21"
uses: "actions/setup-java@v4"
with:
distribution: "graalvm"
java-version: 21
- name: "Install Node.js"
uses: actions/setup-node@v4
with:
node-version: "lts/jod" # 22
- name: "Setup Gradle"
uses: "gradle/actions/setup-gradle@v4"
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/initial-version' }} # TODO remove when initial-version is removed
- name: "Check if binary works"
run: "./gradlew testAllCliNative"
- name: "upload binary" # for debugging
uses: actions/upload-artifact@v4
with:
name: "spotless-native-binary--${{ matrix.platform.name }}"
path: app/build/native/nativeCompile/spotless*
retention-days: 7
if-no-files-found: "error"
# TODO add job to check if jrelease distribute would be working
# eg using `JRELEASER_GITHUB_TOKEN=123 jreleaser -Djreleaser.project.version=0.1.0 publish --dry-run`