Skip to content

Commit

Permalink
Improve GitHub Actions workflow for CI (#892)
Browse files Browse the repository at this point in the history
* Differs matrix job name to handle branch
protection rules properly

* Attempt at renaming the CI actions.

We're not building packages, we're actually running tests.

* Cleanup the Actions Workflow, add a timeout to the Script steps.

* Typo fix for shell's test [ ] command spacing.

Co-authored-by: Dimitri Fontaine <dimitri@citusdata.com>
  • Loading branch information
gurkanindibay and DimCitus committed May 12, 2022
1 parent 753d334 commit de36fb9
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build_package:
name: Build package
name: Run test
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -32,11 +32,12 @@ jobs:
TEST: tablespaces
DOCKERTEST: true
- PGVERSION: 14
TEST: tablespaces
TEST: linting
LINTING: true
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set environment variables
run: |
echo "PGVERSION=${{ matrix.PGVERSION }}" >> $GITHUB_ENV
Expand All @@ -47,10 +48,10 @@ jobs:
- name: Clone and install tools branch
run: |
gcc --version
git clone -b v0.7.22 --depth 1 https://github.com/citusdata/tools.git ../tools
sudo make -C ../tools install
- name: Pre Install steps
run: |
if [ -z "${LINTING}" ]; then setup_apt; fi
Expand All @@ -61,6 +62,7 @@ jobs:
sudo apt-get install libkrb5-dev python3-setuptools
sudo -H pip3 install pyroute2>=0.5.17
pip3 install --user black
- name: Install steps
run: |
if [ -n "${LINTING}" ]; then install_uncrustify; fi
Expand All @@ -70,19 +72,14 @@ jobs:
env
if [ -z "${LINTING}" ]; then pg_config; fi
if [ -z "${LINTING}" ]; then PATH=`pg_config --bindir`:$PATH which pg_ctl; fi
- name: Script steps
timeout-minutes: 15
run: |
echo "Travis build dir: ${TRAVIS_BUILD_DIR}"
if [ -n "${LINTING}" ]; then citus_indent --check; fi
if [ -n "${LINTING}" ]; then black --check .; fi
if [ -n "${LINTING}" ]; then ci/banned.h.sh; fi
if [ -z "${LINTING}"] && [ -z "$DOCKERTEST" ]; then make -j5 CFLAGS=-Werror; fi
if [ -z "${LINTING}"] && [ -z "$DOCKERTEST" ]; then sudo make install; fi
if [ -z "${LINTING}"] && [ -z "$DOCKERTEST" ]; then PATH=`pg_config --bindir`:$PATH make test; fi
set +e
if [ -n "${LINTING}"] && [ -n "$DOCKERTEST" ]; then make test; fi
set -e
- name: After script steps
run: |
if [ -n "${LINTING}"] && [ -n "$DOCKERTEST" ]; then make -C tests/tablespaces teardown; fi
if [ -z "${LINTING}" ]; then make -j5 CFLAGS=-Werror; fi
if [ -z "${LINTING}" ]; then sudo make install; fi
if [ -z "${LINTING}" ]; then PATH=`pg_config --bindir`:$PATH make test; fi

0 comments on commit de36fb9

Please sign in to comment.