Skip to content

chore(deps): bump actions/checkout from 2.4.0 to 4.0.0 #68

chore(deps): bump actions/checkout from 2.4.0 to 4.0.0

chore(deps): bump actions/checkout from 2.4.0 to 4.0.0 #68

Workflow file for this run

name: CI Centos7
on:
push:
branches: [master, 'release/**']
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches: [master, 'release/**']
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test_apisix:
name: run ci on centos7
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
test_dir:
- t/plugin
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/deployment t/discovery t/error_page t/misc
- t/node t/pubsub t/router t/script t/stream-node t/utils t/wasm t/xds-library
steps:
- name: Check out code
uses: actions/[email protected]
with:
submodules: recursive
- name: Extract branch name
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
id: branch_env
shell: bash
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
- name: Extract test type
shell: bash
id: test_env
run: |
test_dir="${{ matrix.test_dir }}"
if [[ $test_dir =~ 't/plugin' ]]; then
echo "##[set-output name=type;]$(echo 'plugin')"
fi
if [[ $test_dir =~ 't/admin ' ]]; then
echo "##[set-output name=type;]$(echo 'first')"
fi
if [[ $test_dir =~ ' t/xds-library' ]]; then
echo "##[set-output name=type;]$(echo 'last')"
fi
- name: Linux launch common services
run: |
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml
- name: Build rpm package
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
run: |
export VERSION=${{ steps.branch_env.outputs.version }}
sudo gem install --no-document fpm
git clone --depth 1 https://github.com/api7/apisix-build-tools.git
# move codes under build tool
mkdir ./apisix-build-tools/apisix
for dir in `ls|grep -v "^apisix-build-tools$"`;do cp -r $dir ./apisix-build-tools/apisix/;done
cd apisix-build-tools
make package type=rpm app=apisix version=${VERSION} checkout=release/${VERSION} image_base=centos image_tag=7 local_code_path=./apisix
cd ..
rm -rf $(ls -1 --ignore=apisix-build-tools --ignore=t --ignore=utils --ignore=ci --ignore=Makefile --ignore=rockspec)
- name: Build xDS library
if: steps.test_env.outputs.type == 'last'
run: |
cd t/xds-library
go build -o libxds.so -buildmode=c-shared main.go export.go
- name: Run centos7 docker and mapping apisix into container
env:
TEST_FILE_SUB_DIR: ${{ matrix.test_dir }}
run: |
docker run -itd -v /home/runner/work/apisix/apisix:/apisix --env TEST_FILE_SUB_DIR="$TEST_FILE_SUB_DIR" --name centos7Instance --net="host" --dns 8.8.8.8 --dns-search apache.org docker.io/centos:7 /bin/bash
# docker exec centos7Instance bash -c "cp -r /tmp/apisix ./"
- name: Start CI env (FIRST_TEST)
if: steps.test_env.outputs.type == 'first'
run: |
make ci-env-up project_compose_ci=ci/pod/docker-compose.${{ steps.test_env.outputs.type }}.yml
- name: Start CI env (PLUGIN_TEST)
if: steps.test_env.outputs.type == 'plugin'
run: |
# download keycloak cas provider
sudo wget https://github.com/jacekkow/keycloak-protocol-cas/releases/download/18.0.2/keycloak-protocol-cas-18.0.2.jar -O /opt/keycloak-protocol-cas-18.0.2.jar
sh ci/pod/openfunction/build-function-image.sh
make ci-env-up project_compose_ci=ci/pod/docker-compose.${{ steps.test_env.outputs.type }}.yml
./ci/init-${{ steps.test_env.outputs.type }}-test-service.sh
- name: Start CI env (LAST_TEST)
if: steps.test_env.outputs.type == 'last'
run: |
# generating SSL certificates for Kafka
keytool -genkeypair -keyalg RSA -dname "CN=127.0.0.1" -alias 127.0.0.1 -keystore ./ci/pod/kafka/kafka-server/selfsigned.jks -validity 365 -keysize 2048 -storepass changeit
make ci-env-up project_compose_ci=ci/pod/docker-compose.${{ steps.test_env.outputs.type }}.yml
./ci/init-${{ steps.test_env.outputs.type }}-test-service.sh
- name: Install dependencies
run: |
docker exec centos7Instance bash -c "cd apisix && ./ci/centos7-ci.sh install_dependencies"
- name: Install rpm package
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
run: |
docker exec centos7Instance bash -c "cd apisix && rpm -iv --prefix=/apisix ./apisix-build-tools/output/apisix-${{ steps.branch_env.outputs.version }}-0.el7.x86_64.rpm"
# Dependencies are attached with rpm, so revert `make deps`
docker exec centos7Instance bash -c "cd apisix && rm -rf deps"
docker exec centos7Instance bash -c "cd apisix && mv usr/bin . && mv usr/local/apisix/* ."
- name: Run test cases
run: |
docker exec centos7Instance bash -c "cd apisix && ./ci/centos7-ci.sh run_case"