Skip to content

Commit

Permalink
build.yml: Adjust ARTIFACT_VERSION and use PR checkout everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
abraxa committed Aug 25, 2024
1 parent 6e0498f commit 5c00ab6
Showing 1 changed file with 93 additions and 6 deletions.
99 changes: 93 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Checkout sigrok-build
# Cannot use actions/checkout because it always checks out the calling actions' repo, not the one specified
run: |
Expand All @@ -72,13 +77,24 @@ jobs:
source sigrok-mxe-init-toolchain.sh
./sigrok-mxe-build-dependencies.sh
- name: Checkout PulseView
- name: Checkout sigrok's PulseView
# Check out default PV repository unless we're processing a pull request
uses: actions/checkout@v4
with:
# TODO: Clone from sigrok.org
repository: sigrokproject/pulseview
path: pulseview

- name: Checkout PulseView from PR
# Check out PV branch of the pull request we're processing
if: (github.event_name == 'pull_request')
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: pulseview
fetch-depth: 0

- name: Build PulseView
run: |
source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh
Expand Down Expand Up @@ -142,6 +158,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Checkout sigrok-build
# Cannot use actions/checkout because it always checks out the calling actions' repo, not the one specified
run: |
Expand All @@ -153,12 +174,24 @@ jobs:
source sigrok-mxe-init-toolchain.sh
./sigrok-mxe-build-dependencies.sh
- name: Checkout sigrok-cli
- name: Checkout sigrok's sigrok-cli
# Check out default sigrok-cli repository unless we're processing a pull request
if: (github.event_name != 'pull_request')
uses: actions/checkout@v4
with:
repository: sigrokproject/sigrok-cli
path: sigrok-cli

- name: Checkout sigrok-cli from PR
# Check out sigrok-cli branch of the pull request we're processing
if: (github.event_name == 'pull_request')
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: sigrok-cli
fetch-depth: 0

- name: Build sigrok-cli
run: |
source sigrok-build/ci/mxe/sigrok-mxe-init-toolchain.sh
Expand Down Expand Up @@ -235,6 +268,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Update dependencies
run: |
sudo apt-get update
Expand All @@ -253,12 +291,24 @@ jobs:
source sigrok-appimage-init-toolchain.sh
./sigrok-appimage-build-dependencies.sh
- name: Checkout PulseView
- name: Checkout sigrok's PulseView
# Check out default PV repository unless we're processing a pull request
uses: actions/checkout@v4
with:
# TODO: Clone from sigrok.org
repository: sigrokproject/pulseview
path: pulseview

- name: Checkout PulseView from PR
# Check out PV branch of the pull request we're processing
if: (github.event_name == 'pull_request')
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: pulseview
fetch-depth: 0

- name: Build PulseView
run: |
source sigrok-build/ci/appimage/sigrok-appimage-init-toolchain.sh
Expand Down Expand Up @@ -333,6 +383,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Update dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -448,6 +503,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Install dependencies
run: |
brew install autoconf automake autoconf-archive pkg-config libtool \
Expand All @@ -469,13 +529,24 @@ jobs:
source sigrok-macos-init-toolchain.sh
./sigrok-macos-build-dependencies.sh
- name: Checkout PulseView
- name: Checkout sigrok's PulseView
# Check out default PV repository unless we're processing a pull request
uses: actions/checkout@v4
with:
# TODO: Clone from sigrok.org
repository: sigrokproject/pulseview
path: pulseview

- name: Checkout PulseView from PR
# Check out PV branch of the pull request we're processing
if: (github.event_name == 'pull_request')
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: pulseview
fetch-depth: 0

- name: Build PulseView
run: |
source sigrok-build/ci/macos/sigrok-macos-init-toolchain.sh
Expand Down Expand Up @@ -522,6 +593,11 @@ jobs:
ARTIFACT_VERSION: "NIGHTLY"

steps:
- name: Set artifact version to PR
if: (github.event_name == 'pull_request')
run: |
echo "ARTIFACT_VERSION=PR${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Install dependencies
run: |
brew install autoconf automake autoconf-archive pkg-config sdcc \
Expand All @@ -539,13 +615,24 @@ jobs:
source sigrok-macos-init-toolchain.sh
./sigrok-macos-build-dependencies.sh
- name: Checkout sigrok-cli
- name: Checkout sigrok's sigrok-cli
# Check out default sigrok-cli repository unless we're processing a pull request
if: (github.event_name != 'pull_request')
uses: actions/checkout@v4
with:
# TODO: Clone from sigrok.org
repository: sigrokproject/sigrok-cli
path: sigrok-cli

- name: Checkout sigrok-cli from PR
# Check out sigrok-cli branch of the pull request we're processing
if: (github.event_name == 'pull_request')
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: sigrok-cli
fetch-depth: 0

- name: Build sigrok-cli
run: |
source sigrok-build/ci/macos/sigrok-macos-init-toolchain.sh
Expand Down

0 comments on commit 5c00ab6

Please sign in to comment.