From 9235fa4923bbf712906f97c81778fc7c22cbd45b Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 27 Apr 2023 12:44:25 +0200 Subject: [PATCH] Create ci-builds.yml --- .github/workflows/ci-builds.yml | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/ci-builds.yml diff --git a/.github/workflows/ci-builds.yml b/.github/workflows/ci-builds.yml new file mode 100644 index 000000000..4c3d59327 --- /dev/null +++ b/.github/workflows/ci-builds.yml @@ -0,0 +1,99 @@ +name: CI-builds + +on: + push: + branches: [ "v2.x" ] + paths-ignore: + - '.github/**' + - '**.md' + pull_request: + branches: [ "v2.x" ] + paths-ignore: + - '.github/**' + - '**.md' +# schedule: +# - cron: '15 13 * * 3' + workflow_dispatch: + +jobs: + builds: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: +# dist: [ 'almalinux8','almalinux9','centos6','centos7','centos8','debian8','debian9','debian10','debian11','fedora27','fedora28','fedora33','fedora34','fedora36','fedora37','opensuse15','ubuntu14','ubuntu16','ubuntu18','ubuntu20','ubuntu22' ] +# dist: [ 'centos6','fedora37' ] +# type: [ '','-dbg','-clang' ] + include: + - dist: 'centos6' + type: '' + - dist: 'ubuntu22' + type: '-tap' + - dist: 'ubuntu22' + type: '-testaurora' + - dist: 'ubuntu22' + type: '-testgalera' + - dist: 'ubuntu22' + type: '-testgrouprep' + - dist: 'ubuntu22' + type: '-testreadonly' + - dist: 'ubuntu22' + type: '-testreplicationlag' + - dist: 'ubuntu22' + type: '-testall' + - dist: 'fedora37' + type: '-clang' + steps: + + - name: Cache build + id: cache + uses: actions/cache@v3 + with: +# key: ${{ github.workflow }}_${{ matrix.dist }}${{ matrix.type }}_${{ env.GIT_VERSION }} + key: ${{ github.workflow }}_${{ github.sha }}_${{ matrix.dist }}${{ matrix.type }} + lookup-only: true + path: | + proxysql/ + + - name: Checkout repository + if: ${{ steps.cache.outputs.cache-hit != 'true' }} + uses: actions/checkout@v3 + with: + repository: 'sysown/proxysql' +# ref: 'v2.x' + fetch-depth: 0 + path: 'proxysql' + +# - name: Set GIT_VERSION +# if: ${{ steps.cache.outputs.cache-hit != 'true' }} +# run: | +# git fetch --tags --force +# GIT_VERSION=$(git describe --long --abbrev=7) +# echo "GIT_VERSION=${GIT_VERSION}" +# echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_ENV + + - name: Build + if: ${{ steps.cache.outputs.cache-hit != 'true' }} + run: | + cd proxysql/ + if [[ "${{ matrix.type }}" =~ "-tap" ]]; then + # build proxysql + sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make debug_clickhouse WITHGCOV=1'" docker-compose.yml + make ${{ matrix.dist }}-dbg + # build tap tests + sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make build_tap_test_debug WITHGCOV=1'" docker-compose.yml + make ${{ matrix.dist }}-dbg + elif [[ "${{ matrix.type }}" =~ "-test" ]]; then + TYPE=${{ matrix.type }} + # build TYPE + sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make ${TYPE#-}'" docker-compose.yml + make ${{ matrix.dist }} + else + make ${{ matrix.dist }}${{ matrix.type }} + fi + + - name: Check + if: ${{ steps.cache.outputs.cache-hit != 'true' }} + run: | + ls -l proxysql/src +