This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
108 lines (104 loc) · 3.38 KB
/
plugin-integration.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
# This workflow is an integration test that
# * builds the plugin and then
# * starts a GoCD docker container with the plugin mounted.
#
# The test only takes a look whether GoCD
# recognizes the plugin correctly.
name: Integration Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
integration_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
- name: Build with Maven
run: mvn -B package --file pom.xml
- uses: actions/upload-artifact@v3
with:
name: plugin
path: target/go-maven-poller-plugin.jar
# integration test by downloading the plugin via curl
# at startup
integration_env:
needs: integration_build
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
include:
- goversion: v23.2.0
accept: application/vnd.go.cd.v7+json
- goversion: v23.1.0
accept: application/vnd.go.cd.v7+json
- goversion: v22.3.0
accept: application/vnd.go.cd.v7+json
- goversion: v22.2.0
accept: application/vnd.go.cd.v7+json
- goversion: v22.1.0
accept: application/vnd.go.cd.v7+json
- goversion: v21.4.0
accept: application/vnd.go.cd.v7+json
- goversion: v21.3.0
accept: application/vnd.go.cd.v7+json
- goversion: v21.2.0
accept: application/vnd.go.cd.v7+json
- goversion: v21.1.0
accept: application/vnd.go.cd.v7+json
- goversion: v20.10.0
accept: application/vnd.go.cd.v7+json
- goversion: v20.9.0
accept: application/vnd.go.cd.v7+json
- goversion: v20.8.0
accept: application/vnd.go.cd.v7+json
- goversion: v20.7.0
accept: application/vnd.go.cd.v7+json
steps:
- uses: actions/checkout@v3
- name: Download the plugin
uses: actions/download-artifact@v3
with:
name: plugin
- name: Install docker compose
run: |
sudo apt-get update && sudo apt-get install --yes docker-compose
- name: Copy the plugin to /tmp for docker compose
run: |
cp go-maven-poller-plugin.jar /tmp
pwd
ls -al
- name: Start the containers
working-directory: ./.github/integration-helper/docker-compose
run: |
pwd
ls -al
echo "goversion=${{ matrix.goversion }}" > .env
docker-compose up --detach
- name: Wait and get the plugin info via API
run: |
bash ./.github/integration-helper/wait-download-plugin_info.sh ${{ matrix.accept }} ${{ matrix.goversion }}
- uses: actions/upload-artifact@v3
with:
name: output-json-${{ matrix.goversion }}
path: plugin_info.json
- name: Kill the containers
working-directory: ./.github/integration-helper/docker-compose
run: |
docker-compose down
- name: Show container logs
working-directory: ./.github/integration-helper/docker-compose
run: |
docker-compose logs gocd-server
docker-compose logs nginx
- name: Test the JSON document for expected values
run: |
bash ./.github/integration-helper/check-plugin_info.sh plugin_info.json || exit 1