Skip to content

Commit

Permalink
update github actions workflow for all branch and so on
Browse files Browse the repository at this point in the history
* support another branch to unify another branch's github actions workflow
* add timeout
* update readme's build status
  • Loading branch information
mikecaat authored Apr 28, 2021
1 parent 23dc7d4 commit 95281f7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 13 deletions.
58 changes: 52 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,68 @@
name: Test with PG13
name: Test

on:
push:
branches: [ master ]
branches:
- master
- REL_13_STABLE
- REL_12_STABLE
- REL_11_STABLE
- REL_10_STABLE
- REL9_6_STABLE
- REL9_5_STABLE
- REL9_4_STABLE
- REL9_3_STABLE
- REL9_2_STABLE
pull_request:
branches: [ master ]
branches:
- master
- REL_13_STABLE
- REL_12_STABLE
- REL_11_STABLE
- REL_10_STABLE
- REL9_6_STABLE
- REL9_5_STABLE
- REL9_4_STABLE
- REL9_3_STABLE
- REL9_2_STABLE
schedule:
- cron: "0 1 * * SUN"
- cron: "0 1 * * SUN" # only master

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
CACHE_VERSION: 20210426 # to identify cache version
PGVERSION: 13.2 # currently, pg_rman supports only stable version.
#PGVERSION: master

steps:
- name: get current branch name
shell: bash -xe {0}
run: |
if [ ${{ github.event_name }} = "pull_request" ]; then
echo "BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
else # push
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
fi
- name: set build postgresql version
shell: bash -xe {0}
run: |
declare -A versions=(
["master"]="13.2" # TODO: build with master branch
["REL_13_STABLE"]="13.2"
["REL_12_STABLE"]="12.6"
["REL_11_STABLE"]="11.11"
["REL_10_STABLE"]="10.16"
["REL9_6_STABLE"]="9.6.21"
["REL9_5_STABLE"]="9.5.25"
["REL9_4_STABLE"]="9.4.26"
["REL9_3_STABLE"]="9.3.25"
["REL9_2_STABLE"]="9.2.24"
)
[ -z "${versions[${{ env.BRANCH }}]}" ] && exit 1 # check if the key exists
echo "PGVERSION=${versions[${{ env.BRANCH }}]}" >> $GITHUB_ENV
- name: cache builded resources
id: cache-postgresql-core
uses: actions/cache@v2
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ different PostgreSQL server versions without introducing server version
check code blocks. Please choose a branch to match the PostgreSQL version
you will be building pg_rman against.

* master : branch for latest PostgreSQL stable version [![Test with PG13](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_13_STABLE : branch for PostgreSQL 13.0
* REL_12_STABLE : branch for PostgreSQL 12.0
* REL_11_STABLE : branch for PostgreSQL 11.0
* REL_10_STABLE : branch for PostgreSQL 10.0
* REL9_6_STABLE : branch for PostgreSQL 9.6
* REL9_5_STABLE : branch for PostgreSQL 9.5
* master : branch for latest PostgreSQL stable version [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_13_STABLE : branch for PostgreSQL 13.0 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_13_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_12_STABLE : branch for PostgreSQL 12.0 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_12_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_11_STABLE : branch for PostgreSQL 11.0 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_11_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL_10_STABLE : branch for PostgreSQL 10.0 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL_10_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL9_6_STABLE : branch for PostgreSQL 9.6 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL9_6_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)
* REL9_5_STABLE : branch for PostgreSQL 9.5 [![Test](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml/badge.svg?branch=REL9_5_STABLE&event=push)](https://github.com/ossc-db/pg_rman/actions/workflows/build.yml)

How to use
----------
Expand Down

0 comments on commit 95281f7

Please sign in to comment.