Repository navigation
125 lines (103 loc) · 4.31 KB
/
Copy pathbuild.yaml
File metadata and controls
125 lines (103 loc) · 4.31 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Build Open Integration Engine
on:
push:
branches:
- main
pull_request:
branches:
- main
# Every job builds the same Dockerfile, so this must match across jobs or they
# miss each other's build cache.
env:
GRADLE_BUILD_ARGS: ${{ github.ref != 'refs/heads/main' && '-PdisableSigning=true -Pcoverage=true' || '' }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
configurations: ${{ steps.configurations.outputs.names }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: List smoke-test configurations
id: configurations
run: |
names=$(basename -s .compose.yml ci/configurations/*.compose.yml | jq -Rsc 'split("\n") - [""]')
echo "names=$names" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Expose GitHub Actions runtime for buildx cache
uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487 # v4.0.0
- name: Build and run tests
run: |
rm -rf docker-build-output
docker buildx build \
--progress=plain \
--build-arg "GRADLE_BUILD_ARGS=${GRADLE_BUILD_ARGS}" \
--cache-from type=gha,scope=oie-build \
--cache-to type=gha,scope=oie-build,mode=max \
--target build-output-export \
--output type=local,dest=docker-build-output \
.
- name: Package distribution
run: tar czf openintegrationengine.tar.gz -C docker-build-output/app/server setup --transform 's|^setup|openintegrationengine/|'
- name: Create artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: oie-build
path: openintegrationengine.tar.gz
- name: Stage Test Results
if: (!cancelled())
run: |
mkdir -p aggregate-test-results
cp -r --parents docker-build-output/app/client/build/test-results aggregate-test-results/
cp -r --parents docker-build-output/app/command/build/test-results aggregate-test-results/
cp -r --parents docker-build-output/app/donkey/build/test-results aggregate-test-results/
cp -r --parents docker-build-output/app/server/build/test-results aggregate-test-results/
- name: Upload Test Results
if: (!cancelled())
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: Test Results (unit)
path: |
aggregate-test-results/**/*.xml
integration-test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configuration: ${{ fromJSON(needs.build.outputs.configurations) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Expose GitHub Actions runtime for buildx cache
uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487 # v4.0.0
# Read-only: the build job populates this cache, and concurrent writers
# from the matrix would just fight over the same scope.
- name: Run integration tests
env:
EXTRA_BUILDX_ARGS: --cache-from type=gha,scope=oie-build
run: ci/runtests.sh ${{ matrix.configuration }}
- name: Upload Test Results
if: (!cancelled())
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: Test Results (${{ matrix.configuration }})
path: |
ci/test-results/**/*.xml
test-results:
needs: [build, integration-test]
if: (!cancelled())
runs-on: ubuntu-latest
steps:
- name: Upload Event File
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: Event File
path: ${{ github.event_path }}
- name: Merge Test Results
uses: actions/upload-artifact/merge@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: Test Results
pattern: Test Results (*)
delete-merged: true