-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (74 loc) · 2.83 KB
/
pr-build.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
name: PR build
on:
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
NAMESPACE: galasa-dev
IMAGE_TAG: main
jobs:
build-cli:
name: Build the Galasa CLI
runs-on: ubuntu-latest
steps:
- name: Checkout CLI
uses: actions/checkout@v4
with:
path: cli
- name: Checkout Framework
uses: actions/checkout@v4
with:
repository: ${{env.NAMESPACE}}/framework
path: framework
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.9.2
- name: Gather dependencies using Gradle
run : |
gradle -b cli/build.gradle installJarsIntoTemplates --info \
-PsourceMaven=https://development.galasa.dev/gh/maven-repo/maven \
-PcentralMaven=https://repo.maven.apache.org/maven2/ \
-PtargetMaven=${{ github.workspace }}/repo \
- name: Generate Go client code using openapi.yaml
run : |
docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/openapi:main java -jar /opt/openapi/openapi-generator-cli.jar generate -i /var/workspace/cli/build/dependencies/openapi.yaml -g go -o /var/workspace/cli/pkg/galasaapi --additional-properties=packageName=galasaapi --global-property=apiTests=false
- name: Clear go.mod
run : |
docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/openapi:main rm /var/workspace/cli/pkg/galasaapi/go.mod
- name: Clear go.sum
run : |
docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/openapi:main rm /var/workspace/cli/pkg/galasaapi/go.sum
# - name: Clear go.mod
# run: |
# rm -v cli/pkg/galasaapi/go.mod
# - name: Clear go.sum
# run : |
# rm -v cli/pkg/galasaapi/go.sum
- name: Update version
run : |
version=$(cat cli/VERSION) &&
cat cli/pkg/cmd/root.go | sed "s/unknowncliversion-unknowngithash/${version}/1" > cli/temp.txt &&
mv -f cli/temp.txt cli/pkg/cmd/root.go &&
cat cli/pkg/cmd/root.go
- name: Build Go code with the Makefile
run : |
make all -C cli/
# test-galasactl-locally:
# name: Run the galasactl local test script
# runs-on: ubuntu-latest
# steps:
# - name: Chmod local test script
# run: |
# chmod +x cli/test-galasactl-local.sh
# - name: Run local test script with maven
# run : |
# ./cli/test-galasactl-local.sh --buildTool maven
# test-galasactl-ecosystem:
# name: Run the galasactl ecosystem test script
# runs-on: ubuntu-latest
# steps:
# build-cli-docker-images:
# name: Build Docker images with the executable and for the development Maven registry
# runs-on: ubuntu-latest
# steps: