Skip to content

Merge branch 'apache:master' into master #61

Merge branch 'apache:master' into master

Merge branch 'apache:master' into master #61

Workflow file for this run

# 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: e2e
on:
pull_request:
push:
branches:
- master
env:
TAG: ${{ github.sha }}
jobs:
changes:
runs-on: ubuntu-latest
outputs:
e2e: ${{ steps.filter.outputs.e2e }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dorny/paths-filter@v2
id: filter
with:
filters: '.github/filters.yml'
list-files: json
build-docker-images:
needs: changes
if: ${{ needs.changes.outputs.e2e == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 8 for Building ShenYu
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build Apache ShenYu with Maven
run: ./mvnw -B clean install -Prelease -Dmaven.javadoc.skip=true -B -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests package
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and Export Admin Image
uses: docker/build-push-action@v3
with:
context: ./shenyu-dist/shenyu-admin-dist
file: ./shenyu-dist/shenyu-admin-dist/docker/Dockerfile
build-args: APP_NAME=apache-shenyu-*-admin-bin
tags: shenyu/admin:latest
outputs: type=docker,dest=/tmp/apache-shenyu-admin.tar
- name: Build and Export Bootstrap Image
uses: docker/build-push-action@v3
with:
context: ./shenyu-dist/shenyu-bootstrap-dist
file: ./shenyu-dist/shenyu-bootstrap-dist/docker/Dockerfile
build-args: APP_NAME=apache-shenyu-*-bootstrap-bin
tags: shenyu/bootstrap:latest
outputs: type=docker,dest=/tmp/apache-shenyu-bootstrap.tar
- name: Load ShenYu Docker Images
run: |
docker load --input /tmp/apache-shenyu-admin.tar
docker load --input /tmp/apache-shenyu-bootstrap.tar
docker image ls -a
- name: Set up JDK 11 for Compiling ShenYu E2E Egnine
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build shenyu-e2e-engine with Maven
run: ./mvnw -B -f ./shenyu-e2e/pom.xml -am -pl shenyu-e2e-engine clean install
- name: Upload Docker Image Artifacts
uses: actions/upload-artifact@v3
with:
name: shenyu-images
path: /tmp/apache-shenyu-*.tar
retention-days: 1
e2e:
runs-on: ubuntu-latest
needs:
- changes
- build-docker-images
if: ${{ needs.changes.outputs.e2e == 'true' }}
strategy:
matrix:
storage: [ "h2", "mysql", "postgres" ]
steps:
- uses: actions/download-artifact@v3
with:
name: shenyu-images
path: /tmp/
- name: Load ShenYu Docker Images
run: |
docker load --input /tmp/apache-shenyu-admin.tar
docker load --input /tmp/apache-shenyu-bootstrap.tar
docker image ls -a
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Run ShenYu E2E Tests
env:
storage: ${{ matrix.storage }}
run: |
bash ./shenyu-e2e/script/storage_init.sh
./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-http -Dstorage=${{ matrix.storage }} test
e2e-case:
runs-on: ubuntu-latest
needs:
- changes
- build-docker-images
if: ${{ needs.changes.outputs.e2e == 'true' }}
strategy:
matrix:
case: [ "shenyu-e2e-case-spring-cloud" ]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 8 for Building ShenYu
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- uses: actions/download-artifact@v3
with:
name: shenyu-images
path: /tmp/
- name: Load ShenYu Docker Images
run: |
docker load --input /tmp/apache-shenyu-admin.tar
docker load --input /tmp/apache-shenyu-bootstrap.tar
docker image ls -a
- name: Build examples with Maven
run: ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -f ./shenyu-examples/pom.xml
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Run ShenYu E2E Tests
env:
storage: mysql
run: |
bash ./shenyu-e2e/script/storage_init.sh
./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/${{ matrix.case }} -Dstorage=mysql test
requirement:
name: e2e
if: ${{ needs.changes.outputs.e2e == 'true' }}
needs:
- changes
- e2e
- e2e-case
runs-on: ubuntu-latest
steps:
- name: checking job status
run: |
[[ "${{ needs.e2e.result }}" == "success" ]] || exit -1