Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slice CI pipeline to different steps #5

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 105 additions & 29 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,16 @@ name: regression check
on: [push]

jobs:
regression-check:
name: run regression test suite
pgbuild:
name: build postgres
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 2

- name: Form variables for notification message
id: git_info_grab
run: |
git_stat=$(git show --stat=50)
git_stat="${git_stat//'%'/'%25'}"
git_stat="${git_stat//$'\n'/'%0A'}"
git_stat="${git_stat//$'\r'/'%0D'}"
git_stat="${git_stat// / }" # space -> 'Space En', as github tends to eat ordinary spaces
echo "::set-output name=git_stat::$git_stat"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "##[set-output name=git_branch;]$(echo ${GITHUB_REF#refs/heads/})"

- name: Send notification
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
args: |
*@${{ github.actor }} pushed to* [${{ github.repository }}:${{steps.git_info_grab.outputs.git_branch}}](github.com/${{ github.repository }}/commit/${{steps.git_info_grab.outputs.sha_short }})

```
${{ steps.git_info_grab.outputs.git_stat }}
```

- name: Install postgres dependencies
run: |
sudo apt update
Expand All @@ -62,6 +35,38 @@ jobs:
run: |
./pgbuild.sh

- name: Upload postgres build
uses: actions/upload-artifact@v2
with:
name: pg_build
path: |
tmp_install/bin
tmp_install/include
tmp_install/lib
tmp_install/share
tmp_install/build/src/test/regress/pg_regress

pg_regress:
name: postgres regression test
needs: pgbuild
runs-on: ubuntu-latest
steps:
- name: Load pg build
uses: actions/download-artifact@v2
with:
name: pg_build

- name: Run pg_regress
run: |
pwd
ls -al
cd build && make check

zenith_build:
name: build zenith crates
needs: pgbuild
runs-on: ubuntu-latest
steps:
- name: Install rust
run: |
sudo apt install -y cargo
Expand All @@ -83,6 +88,77 @@ jobs:
run: |
cargo build

- name: Upload zenith build
uses: actions/upload-artifact@v2
with:
name: zenith_build_with_deps
path: |
~/.cargo/registry
~/.cargo/git
target

zenith_integration:
name: zenith integration tests
needs: zenith_build
runs-on: ubuntu-latest
steps:
- name: Load pg build
uses: actions/download-artifact@v2
with:
name: pg_build

- name: Load zenith build
uses: actions/download-artifact@v2
with:
name: zenith_build_with_deps

- name: Run test
run: |
cargo test --test test_pageserver -- --nocapture --test-threads=1

zenith_fmt:
name: check code formatting
needs: zenith_build
runs-on: ubuntu-latest
steps:
- name: Load zenith build
uses: actions/download-artifact@v2
with:
name: zenith_build_with_deps

- name: Run cargo fmt
run: |
cargo fmt -- --check

notify:
name: send notifications
needs: pgbuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Form variables for notification message
id: git_info_grab
run: |
git_stat=$(git show --stat=50)
git_stat="${git_stat//'%'/'%25'}"
git_stat="${git_stat//$'\n'/'%0A'}"
git_stat="${git_stat//$'\r'/'%0D'}"
git_stat="${git_stat// / }" # space -> 'Space En', as github tends to eat ordinary spaces
echo "::set-output name=git_stat::$git_stat"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "##[set-output name=git_branch;]$(echo ${GITHUB_REF#refs/heads/})"

- name: Send notification
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
args: |
*@${{ github.actor }} pushed to* [${{ github.repository }}:${{steps.git_info_grab.outputs.git_branch}}](github.com/${{ github.repository }}/commit/${{steps.git_info_grab.outputs.sha_short }})

```
${{ steps.git_info_grab.outputs.git_stat }}
```