-
Notifications
You must be signed in to change notification settings - Fork 4
148 lines (128 loc) · 5.26 KB
/
gretl.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: gretl
on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
- 'openshift/**'
- '**.md'
branches-ignore:
- publisher
jobs:
build:
#runs-on: ubuntu-20.04
runs-on: ubuntu-20.04
env:
BUILD_NUMBER: ${{ github.run_number }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew clean gretl:classes
- name: Unit Tests and publish plugin to local maven repo
run: |
TZ="Europe/Zurich" ./gradlew gretl:test gretl:dbTest
./gradlew clean gretl:s3Test -Ds3AccessKey=$S3_ACCESS_KEY -Ds3SecretKey=$S3_SECRET_KEY -Ds3BucketName=ch.so.agi.gretl.test
./gradlew gretl:build gretl:publishPluginMavenPublicationToMavenLocal -x test
# run: |
# ./gradlew gretl:build gretl:publishPluginMavenPublicationToMavenLocal -x test
env:
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
- name: Integration Test (Jar)
run: |
TZ="Europe/Zurich" ./gradlew gretl:jarTest
./gradlew gretl:jarS3Test -Ds3AccessKey=$S3_ACCESS_KEY -Ds3SecretKey=$S3_SECRET_KEY -Ds3BucketName=ch.so.agi.gretl.test
env:
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: reports-jar
path: gretl/build/reports/tests/
- name: Stage jar files
run: |
./gradlew stageJars
ls -la runtimeImage/gretl/__jars4image
# - name: Debug1
# run: |
# ls -la ~/.m2/repository/ch/so/agi/gretl
- name: Set up QEMU for amd64 and arm64
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1.2.0 (2021-10-22)
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # v1.6.0 (2021-10-22)
- name: Docker meta
id: meta
uses: docker/metadata-action@3a3bb3a81753dc99f090d24ee7e5343838b73a96 # v3.5.0 (2021-10-22)
with:
images: sogis/gretl
labels: |
org.opencontainers.image.title=gretl
org.opencontainers.image.version=2.2.${{ github.run_number }}
org.opencontainers.image.base.name=docker.io/bellsoft/liberica-openjdk-alpine:8u333-2
tags: |
type=raw,value=2.3.${{ github.run_number }},enable=true,priority=200
type=raw,value=2.3,enable=true,priority=200
type=raw,value=2,enable=true,priority=200
type=raw,value=latest,enable=true,priority=200
- name: Login to GitHub Container Registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # v1.10.0 (2021-10-22)
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') && !env.ACT }}
- name: Single-platform build
uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 # v2.7.0 (2021-10-22)
with:
platforms: linux/amd64
context: ./runtimeImage/gretl
file: ./runtimeImage/gretl/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: true
pull: true
- name: List images
run: |
docker images
- name: Integration Test (Docker Image)
run: |
TZ="Europe/Zurich" ./gradlew gretl:imageTest
./gradlew gretl:imageS3Test -Ds3AccessKey=$S3_ACCESS_KEY -Ds3SecretKey=$S3_SECRET_KEY -Ds3BucketName=ch.so.agi.gretl.test
env:
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: reports-docker
path: |
gretl/build/reports/tests/
- name: Publish plugin
run: ./gradlew gretl:publishPlugins -s
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') && !env.ACT }}
env:
gradlePublishKey: ${{ secrets.GRADLEPUBLISHKEY }}
gradlePublishSecret: ${{ secrets.GRADLEPUBLISHSECRET }}
- name: Multi-platform build
uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 # v2.7.0 (2021-10-22)
with:
platforms: linux/amd64,linux/arm64
context: ./runtimeImage/gretl
file: ./runtimeImage/gretl/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pull: true
push: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') && !env.ACT }}