|
1 | 1 | name: Test workflow
|
2 | 2 |
|
3 | 3 | on:
|
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
4 | 9 | workflow_dispatch:
|
| 10 | + inputs: |
| 11 | + bitcoin-sv-input: |
| 12 | + description: 'Optionally build bdk with custom bitcoin-sv commit' |
| 13 | + required: false |
| 14 | + default: 394645fcba643e5f7090ff1beb246a2b72b3b172 |
| 15 | + |
| 16 | +env: |
| 17 | + DEFAULT_BITCOIN_SV_COMMIT: 394645fcba643e5f7090ff1beb246a2b72b3b172 |
5 | 18 |
|
6 | 19 | jobs:
|
7 | 20 | build-bdk:
|
8 | 21 | strategy:
|
9 | 22 | matrix:
|
10 |
| - os: [linux-arm64-8-core, ubuntu-24.04, macos-15] |
| 23 | + os: [linux-arm64-8-core, ubuntu-24.04, macos-15, macos-13] |
11 | 24 | fail-fast: false
|
12 | 25 | runs-on: ${{ matrix.os }}
|
13 | 26 |
|
14 | 27 | steps:
|
15 | 28 | - name: Checkout repository
|
16 | 29 | uses: actions/checkout@v4
|
17 | 30 |
|
| 31 | + - name: Define dependant bitcoin-sv commit |
| 32 | + id: define-bitcoin-sv-commit |
| 33 | + run: | |
| 34 | + # Use dispatch input if present, otherwise default from env |
| 35 | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
| 36 | + bsvcommit="${{ github.event.inputs.bitcoin-sv-input }}" |
| 37 | + else |
| 38 | + bsvcommit="${{ env.DEFAULT_BITCOIN_SV_COMMIT }}" |
| 39 | + fi |
| 40 | + echo "Build using bsvcommit=$bsvcommit ..." |
| 41 | + echo "bsvcommit=$bsvcommit" >> "$GITHUB_OUTPUT" |
| 42 | +
|
| 43 | + - name: Check out bitcoin-sv |
| 44 | + run: | |
| 45 | + echo "Checking out bitcoin-sv at commit ${{ steps.define-bitcoin-sv-commit.outputs.bsvcommit }} ..." |
| 46 | + git clone https://x-access-token:${{ secrets.BITCOIN_SV_PAT }}@github.com/nchain-research/bitcoin-sv-staging.git bitcoin-sv |
| 47 | + cd bitcoin-sv && git checkout ${{ steps.define-bitcoin-sv-commit.outputs.bsvcommit }} && git log -3 && pwd && cd .. |
| 48 | + echo "Successfully checked out bitcoin-sv commit ${{ steps.define-bitcoin-sv-commit.outputs.bsvcommit }} to bitcoin-sv" |
| 49 | +
|
18 | 50 | - name: Get OS ARCH Name
|
19 | 51 | run: |
|
20 | 52 | echo "OS_ARCH=$(uname -s | tr 'A-Z' 'a-z')_$(uname -m)" >> $GITHUB_ENV
|
|
0 commit comments