Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 10 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,36 @@ jobs:

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
with:
fetch-depth: 0

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
with:
node-version: ${{ env.NODE_VERSION }}

- if: ${{ runner.os == 'Windows' && github.ref == 'refs/heads/master'}}
- if: ${{ runner.os == 'Windows' && ( github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV

- if: ${{ matrix.docker == true && matrix.alpine == true && github.ref == 'refs/heads/master'}}
- if: ${{ (matrix.docker == true && matrix.alpine == true) && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
name: prebuild linux ${{ matrix.arch }} musl
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20-alpine bin/sh -c 'apk add bash && cd /home && bash -c "/home/script/ci/prebuild-alpine.sh" && rm -rf ffi node_modules'

- if: ${{ matrix.docker == true && matrix.alpine != true && github.ref == 'refs/heads/master' }}
- if: ${{ (matrix.docker == true && matrix.alpine != true )&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
name: prebuild linux ${{ matrix.arch }}
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20 bin/bash -c 'cd /home && /home/script/ci/prebuild.sh && rm -rf ffi node_modules'

- run: sudo chown -R $(id -u):$(id -g) prebuilds
if: ${{ matrix.docker == true && github.ref == 'refs/heads/master' }}
if: ${{ matrix.docker == true && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}

- run: ./script/ci/prebuild.sh
if: ${{ matrix.docker != true && github.ref == 'refs/heads/master'}}
if: ${{ matrix.docker != true && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}

- name: Upload prebuild for ${{ runner.os }}-${{ runner.arch }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
with:
path: prebuilds/*.tar.gz
name: artifact-${{ matrix.docker == true && matrix.alpine == true && 'linux-musl' || matrix.docker == true && matrix.alpine == false && 'linux' || matrix.os }}-${{ matrix.arch }}
Expand Down Expand Up @@ -159,10 +159,10 @@ jobs:
fetch-depth: 0

- name: Download prebuilds
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
- run: FETCH_ASSETS=true REPO=pact-foundation/pact-js-core ./script/ci/check-release-libs.sh --fetch-assets
if: github.ref != 'refs/heads/master'
if: ${{ github.ref != 'refs/heads/master' && !contains(github.event.pull_request.title, '(rebuild)')}}
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
9 changes: 9 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ Publishing packages with `--dry-run` option removed.
PUBLISH=true ./script/ci/build-opt-dependencies.sh publish
```

### Generating new prebuilds in CI

For speed, CI runs use prebuilds from master for test runs. If you wish to force a rebuild of the ffi package because

- the ffi library has been updated
- the ffi binding code has been updated

Raise a pull request and add `(rebuild)`, anywhere in the title'

### Linux x86_64 Task

#### Pre Reqs
Expand Down
4 changes: 2 additions & 2 deletions script/create-pr-to-update-pact-ffi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ cat src/ffi/index.ts | sed "s/export const PACT_FFI_VERSION.*/export const PACT_
mv tmp-install src/ffi/index.ts

git add src/ffi/index.ts
git commit -m "${TYPE}: update pact-ffi to ${FFI_VERSION}"
git commit -m "${TYPE}: (rebuild) - update pact-ffi to ${FFI_VERSION}"
git push --set-upstream origin ${BRANCH_NAME}

gh pr create --title "${TYPE}: update pact-ffi to ${FFI_VERSION}" --fill
gh pr create --title "${TYPE}: (rebuild) - update pact-ffi to ${FFI_VERSION}" --fill

git checkout master
2 changes: 1 addition & 1 deletion src/ffi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import logger, { DEFAULT_LOG_LEVEL } from '../logger';
import { LogLevel } from '../logger/types';
import { Ffi, FfiLogLevelFilter } from './types';

export const PACT_FFI_VERSION = '0.4.22';
export const PACT_FFI_VERSION = '0.4.28';

/**
* Returns the library path which is located inside `node_modules`
Expand Down
Loading