mirror of https://github.com/citusdata/citus.git
111 lines
3.7 KiB
YAML
111 lines
3.7 KiB
YAML
name: Build & Test
|
|
run-name: Build & Test - ${{ github.event.pull_request.title || github.ref_name }}
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
skip_test_flakyness:
|
|
required: false
|
|
default: true
|
|
type: boolean
|
|
push:
|
|
branches:
|
|
- "main"
|
|
- "release-*"
|
|
pull_request:
|
|
types: [opened, reopened,synchronize]
|
|
merge_group:
|
|
jobs:
|
|
# Since GHA does not interpolate env varibles in matrix context, we need to
|
|
# define them in a separate job and use them in other jobs.
|
|
params:
|
|
runs-on: ubuntu-latest
|
|
name: Initialize parameters
|
|
outputs:
|
|
build_image_name: "citus/extbuilder"
|
|
test_image_name: "citus/exttester"
|
|
citusupgrade_image_name: "citus/citusupgradetester"
|
|
fail_test_image_name: "citus/failtester"
|
|
pgupgrade_image_name: "citus/pgupgradetester"
|
|
style_checker_image_name: "citus/stylechecker"
|
|
style_checker_tools_version: "0.8.18"
|
|
image_suffix: "-v390dab3"
|
|
pg14_version: '{ "major": "14", "full": "14.11" }'
|
|
pg15_version: '{ "major": "15", "full": "15.6" }'
|
|
pg16_version: '{ "major": "16", "full": "16.2" }'
|
|
upgrade_pg_versions: "14.11-15.6-16.2"
|
|
steps:
|
|
# Since GHA jobs needs at least one step we use a noop step here.
|
|
- name: Set up parameters
|
|
run: echo 'noop'
|
|
build:
|
|
needs: params
|
|
name: Build for PG${{ fromJson(matrix.pg_version).major }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
image_name:
|
|
- ${{ needs.params.outputs.build_image_name }}
|
|
image_suffix:
|
|
- ${{ needs.params.outputs.image_suffix}}
|
|
pg_version:
|
|
- ${{ needs.params.outputs.pg16_version }}
|
|
runs-on: ubuntu-20.04
|
|
container:
|
|
image: "${{ matrix.image_name }}:${{ fromJson(matrix.pg_version).full }}${{ matrix.image_suffix }}"
|
|
options: --user root
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Expose $PG_MAJOR to Github Env
|
|
run: echo "PG_MAJOR=${PG_MAJOR}" >> $GITHUB_ENV
|
|
shell: bash
|
|
- name: Build
|
|
run: "./ci/build-citus.sh"
|
|
shell: bash
|
|
- uses: actions/upload-artifact@v3.1.1
|
|
with:
|
|
name: build-${{ env.PG_MAJOR }}
|
|
path: |-
|
|
./build-${{ env.PG_MAJOR }}/*
|
|
./install-${{ env.PG_MAJOR }}.tar
|
|
test-citus:
|
|
name: PG${{ fromJson(matrix.pg_version).major }} - ${{ matrix.make }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
suite:
|
|
- regress
|
|
image_name:
|
|
- ${{ needs.params.outputs.test_image_name }}
|
|
pg_version:
|
|
- ${{ needs.params.outputs.pg16_version }}
|
|
make:
|
|
- check-enterprise
|
|
runs-on: ubuntu-20.04
|
|
container:
|
|
image: "${{ matrix.image_name }}:${{ fromJson(matrix.pg_version).full }}${{ needs.params.outputs.image_suffix }}"
|
|
options: --user root --dns=8.8.8.8
|
|
# Due to Github creates a default network for each job, we need to use
|
|
# --dns= to have similar DNS settings as our other CI systems or local
|
|
# machines. Otherwise, we may see different results.
|
|
needs:
|
|
- params
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: "./.github/actions/setup_extension"
|
|
- name: Run Test
|
|
run: gosu circleci make -C src/test/${{ matrix.suite }} ${{ matrix.make }}
|
|
timeout-minutes: 20
|
|
- uses: "./.github/actions/save_logs_and_results"
|
|
if: always()
|
|
with:
|
|
folder: ${{ fromJson(matrix.pg_version).major }}_${{ matrix.make }}
|
|
- uses: "./.github/actions/upload_coverage"
|
|
if: always()
|
|
with:
|
|
flags: ${{ env.PG_MAJOR }}_${{ matrix.suite }}_${{ matrix.make }}
|
|
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|