|
11 | 11 | jobs: |
12 | 12 | build: |
13 | 13 | runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + pg-version: [14] |
14 | 18 | steps: |
15 | | - - name: Get latest commit id of PostgreSQL 14 |
| 19 | + - name: Add PG_VERSION to env |
16 | 20 | run: | |
17 | | - echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_14_STABLE | awk '{print $1}')" >> $GITHUB_ENV |
| 21 | + echo "PG_VERSION=${{ matrix.pg-version }}" >> $GITHUB_ENV |
| 22 | + echo "PG_SRC_DIR=$HOME/pg${{ matrix.pg-version }}" >> $GITHUB_ENV |
18 | 23 |
|
19 | | - - name: Cache PostgreSQL 14 |
| 24 | + - name: Get latest commit id of PostgreSQL ${{ env.PG_VERSION }} |
| 25 | + run: | |
| 26 | + echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_${PG_VERSION}_STABLE | awk '{print $1}')" >> $GITHUB_ENV |
| 27 | +
|
| 28 | + - name: Cache PostgreSQL ${{ env.PG_VERSION }} |
20 | 29 | uses: actions/cache@v3 |
21 | | - id: pg14cache |
| 30 | + id: pg-source-cache |
22 | 31 | with: |
23 | | - path: ~/pg14 |
24 | | - key: ${{ runner.os }}-v1-pg14-${{ env.PG_COMMIT_HASH }} |
| 32 | + path: ${{ env.PG_SRC_DIR }} |
| 33 | + key: ${{ runner.os }}-v2-pg-${{ env.PG_COMMIT_HASH }} |
25 | 34 |
|
26 | | - - name: Install PostgreSQL 14 |
27 | | - if: steps.pg14cache.outputs.cache-hit != 'true' |
| 35 | + - name: Install PostgreSQL ${{ env.PG_VERSION }} |
| 36 | + if: steps.pg-source-cache.outputs.cache-hit != 'true' |
28 | 37 | run: | |
29 | | - git clone --depth 1 --branch REL_14_STABLE git://git.postgresql.org/git/postgresql.git ~/pg14source |
30 | | - cd ~/pg14source |
31 | | - ./configure --prefix=$HOME/pg14 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert |
| 38 | + git clone --depth 1 --branch REL_${PG_VERSION}_STABLE git://git.postgresql.org/git/postgresql.git $PG_SRC_DIR |
| 39 | + cd $PG_SRC_DIR |
| 40 | + ./configure --prefix=$PG_SRC_DIR CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert |
32 | 41 | make install -j$(nproc) > /dev/null |
33 | 42 |
|
34 | 43 | - uses: actions/checkout@v3 |
35 | 44 |
|
36 | 45 | - name: Build |
37 | 46 | id: build |
38 | 47 | run: | |
39 | | - make PG_CONFIG=$HOME/pg14/bin/pg_config install -j$(nproc) |
| 48 | + make PG_CONFIG=$PG_SRC_DIR/bin/pg_config install -j$(nproc) |
40 | 49 |
|
41 | 50 | - name: Package Extension |
42 | 51 | id: package |
43 | 52 | run: | |
44 | 53 | npm install |
45 | | - npm run main -- --pgVersion 14 |
| 54 | + npm run main -- --pgVersion $PG_VERSION |
46 | 55 | working-directory: ${{ github.workspace }}/packaging |
47 | 56 |
|
48 | 57 | - name: Upload Release Asset |
|
0 commit comments