forked from apache/trafficcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (168 loc) · 5.74 KB
/
cache-config-tests.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: T3C Integration Tests
env:
ATS_VERSION: 9.2.x
RHEL_VERSION: 8
TARGET_ARCH: x86_64
on:
workflow_dispatch:
push:
paths:
- cache-config/**.go
- cache-config/testing/**
- .github/actions/build-ats-test-rpm/**
- .github/actions/cache-config-integration-tests/**
- .github/actions/repo-info/**
- .github/workflows/cache-config-tests.yml
- go.mod
- go.sum
- GO_VERSION
- lib/atscfg-go/**.go
- lib/go-atscfg/**.go
- '!**_test.go'
- 'cache-config/testing/**_test.go'
- 'traffic_ops/app/db/**'
- '!traffic_ops/app/db/**.md'
- traffic_ops/*client/**.go
- 'traffic_ops/install/**'
- traffic_ops/toclientlib/**.go
- traffic_ops/traffic_ops_golang/**.go
- vendor/**.go
- vendor/modules.txt
pull_request:
paths:
- cache-config/**.go
- cache-config/testing/**
- .github/actions/build-ats-test-rpm/**
- .github/actions/cache-config-integration-tests/**
- .github/actions/repo-info/**
- .github/workflows/cache-config-tests.yml
- go.mod
- go.sum
- GO_VERSION
- lib/atscfg-go/**.go
- lib/go-atscfg/**.go
- '!**_test.go'
- 'cache-config/testing/**_test.go'
- 'traffic_ops/app/db/**'
- '!traffic_ops/app/db/**.md'
- traffic_ops/*client/**.go
- 'traffic_ops/install/**'
- traffic_ops/toclientlib/**.go
- traffic_ops/traffic_ops_golang/**.go
- vendor/**.go
- vendor/modules.txt
types: [opened, reopened, ready_for_review, synchronize]
jobs:
traffic_ops:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Build RPM
uses: ./.github/actions/build-rpms
env:
ATC_COMPONENT: ${{ github.job }}
- name: Upload RPM
uses: actions/upload-artifact@v2
with:
name: ${{ github.job }}
path: ${{ github.workspace }}/dist/${{ github.job }}-*.x86_64.rpm
cache-config:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Build RPM
uses: ./.github/actions/build-rpms
env:
ATC_COMPONENT: ${{ github.job }}
- name: Upload RPM
uses: actions/upload-artifact@v2
with:
name: ${{ github.job }}
path: ${{ github.workspace }}/dist/trafficcontrol-${{ github.job }}-*.x86_64.rpm
trafficserver:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get expected RPM name
uses: ./.github/actions/repo-info
with:
owner: apache
repo: trafficserver
branch: ${{ env.ATS_VERSION }}
id: repo-info
- name: Check Cache
id: ats-rpm-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/dist
key: ${{ steps.repo-info.outputs.expected-rpm-name }}-${{ hashFiles('cache-config/testing/docker/trafficserver/**') }}
- name: Build ATS RPM
if: steps.ats-rpm-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/build-ats-test-rpm
env:
ATC_COMPONENT: ${{ github.job }}
- name: Check ATS RPM name
run: |
set -o errexit -o nounset -o xtrace
actual_rpm_name="$(ls dist | grep -E '^trafficserver-[0-9.]+-[0-9]+\.[0-9a-f]+.el${{ env.RHEL_VERSION }}.${{ env.TARGET_ARCH }}.rpm$')"
[[ "${{ steps.repo-info.outputs.expected-rpm-name }}" == "$actual_rpm_name" ]]
- name: Upload RPM
uses: actions/upload-artifact@v2
with:
name: ${{ github.job }}
path: ${{ github.workspace }}/dist/${{ github.job }}-*.x86_64.rpm
cache-config_tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs:
- traffic_ops
- cache-config
- trafficserver
steps:
- name: Checkout
uses: actions/checkout@master
- name: Download TO RPM
uses: actions/download-artifact@v2
with:
name: traffic_ops
path: ${{ github.workspace }}/cache-config/testing/docker/traffic_ops
- name: Download Cache Config RPM
uses: actions/download-artifact@v2
with:
name: cache-config
path: ${{ github.workspace }}/cache-config/testing/docker/ort_test
- name: Download ATS RPM
uses: actions/download-artifact@v2
with:
name: trafficserver
path: ${{ github.workspace }}/cache-config/testing/docker/yumserver/test-rpms
- name: Build cache config test containers
run: docker compose -f ${{ github.workspace }}/cache-config/testing/docker/docker-compose.yml build --parallel
- name: Run cache config integration tests
uses: ./.github/actions/cache-config-integration-tests