blob: 067d67b5ca12bf072ca5f397ccad28f95fcefeb9 [file] [log] [blame]
# 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: CDN-in-a-Box CI
env:
RHEL_VERSION: 8
# alpine:3.13
ALPINE_VERSION: sha256:08d6ca16c60fe7490c03d10dc339d9fd8ea67c6466dea8d558526b1330a85930
on:
push:
paths-ignore:
- '*.*'
- '**/.gitignore'
- '**/*.md'
- '**/test/**'
- 'blueprints/**'
- '!cache-config/testing/docker/docker-compose-ats-build.yml'
- '!cache-config/testing/docker/trafficserver/**'
- 'docs/**'
- 'experimental/**'
- '.github/**'
- '!.github/actions/build-ciab/*'
- '!.github/actions/build-rpms/*'
- '!.github/actions/run-ciab/*'
- '!infrastructure/cdn-in-a-box/optional/**'
- '!.github/workflows/ciab.yaml'
- 'infrastructure/ansible/**'
- 'LICENSE'
- 'licenses/**'
- 'misc/**'
- 'NOTICE'
- 'traffic_control/java/**'
- 'cache-config/testing/**'
- 'traffic_ops/testing/**'
create:
pull_request:
paths-ignore:
- '*.*'
- '**/.gitignore'
- '**/*.md'
- '**/test/**'
- 'blueprints/**'
- '!cache-config/testing/docker/docker-compose-ats-build.yml'
- '!cache-config/testing/docker/trafficserver/**'
- 'docs/**'
- 'experimental/**'
- '.github/**'
- '!.github/actions/build-ciab/*'
- '!.github/actions/build-rpms/*'
- '!.github/actions/run-ciab/*'
- '!infrastructure/cdn-in-a-box/optional/**'
- '!.github/workflows/ciab.yaml'
- 'infrastructure/ansible/**'
- 'LICENSE'
- 'licenses/**'
- 'misc/**'
- 'NOTICE'
- 'traffic_control/java/**'
- 'cache-config/testing/**'
- 'traffic_ops/testing/**'
types: [ opened, reopened, ready_for_review, synchronize ]
jobs:
traffic_monitor:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
traffic_ops:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
cache-config:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
traffic_portal:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cache node modules
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('traffic_portal/**/package*.json') }}-
restore-keys: |
${{ runner.os }}-node-modules-
- 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 }}-*.rpm
traffic_router:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- 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/*.rpm
traffic_stats:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
grove:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
grovetccfg:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- 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 }}-*.rpm
trafficserver:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get commit sha
uses: ./.github/actions/fetch-github-branch-sha
with:
owner: apache
repo: trafficserver
branch: 8.1.x
id: git-repo-sha
- name: Check Cache
id: ats-rpm-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/dist
key: ${{ steps.git-repo-sha.outputs.sha }}-el${{ env.RHEL_VERSION }}-${{ 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: Display structure of dist directory
run: ls -lR
working-directory: ${{ github.workspace }}/dist
- name: Upload RPM
uses: actions/upload-artifact@v2
with:
name: ${{ github.job }}
path: ${{ github.workspace }}/dist/${{ github.job }}-*.x86_64.rpm
ciab-build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs:
- cache-config
- traffic_monitor
- traffic_ops
- traffic_portal
- traffic_router
- traffic_stats
- trafficserver
steps:
- name: Checkout
uses: actions/checkout@master
- name: Cache Alpine Docker image
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/docker-images
key: docker-images/alpine@${{ env.ALPINE_VERSION }}.tar.gz
- name: Import cached Alpine Docker image
run: .github/actions/save-alpine-tar/entrypoint.sh load ${{ env.ALPINE_VERSION }}
- name: Download RPMs
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }}/dist/
- name: Build CDN-in-a-Box images
uses: ./.github/actions/build-ciab
- name: Start CDN-in-a-Box
uses: ./.github/actions/run-ciab
- name: Upload CDN-in-a-Box logs
uses: actions/upload-artifact@v2
with:
name: ciab-logs
path: infrastructure/cdn-in-a-box/logs/*.log
if: ${{ failure() }}
- name: Save Alpine Docker image
run: .github/actions/save-alpine-tar/entrypoint.sh save ${{ env.ALPINE_VERSION }}