forked from hyperledger/besu
-
Notifications
You must be signed in to change notification settings - Fork 58
99 lines (82 loc) · 2.65 KB
/
workflow.yaml
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
name: CI
on:
push:
branches:
- zkbesu
pull_request:
branches:
- zkbesu
jobs:
build_and_test:
runs-on: ubuntu-latest-128
env:
architecture: "amd64"
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Spotless
run: ./gradlew spotlessCheck
- name: Test & Build
run: ./gradlew build
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: JUnit Tests # Name of the check run which will be created
path: '**/test-results/test/*.xml' # Path to test results
reporter: java-junit # Format of test results
only-summary: true
max-annotations: 50
publish:
needs: build_and_test
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest-128
env:
architecture: "amd64"
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Publish Java artifacts
run: ./gradlew publish
env:
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Publish distribution artifacts
run: |
sudo apt update
sudo apt install -y python3 python3-pip python3-venv
./gradlew cloudsmithUpload
env:
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Check Dockerfile syntax
run: |
docker run --rm -i hadolint/hadolint < docker/Dockerfile
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}
- name: Build and Publish Docker Image
run: |
./gradlew -Pdocker-platform=linux/amd64,linux/arm64 distDocker