Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run hpc-ci on PRs filed from forks #61

Merged
merged 2 commits into from
Feb 6, 2025
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
17 changes: 12 additions & 5 deletions .github/workflows/build-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
# Allow workflow to be dispatched on demand
workflow_dispatch: ~

# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]

env:
ECWAM_TOOLS: ${{ github.workspace }}/.github/tools
CTEST_PARALLEL_LEVEL: 1
Expand All @@ -17,6 +21,7 @@ env:
jobs:
ci-hpc:
name: ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}

strategy:
fail-fast: false # false: try to complete all jobs
Expand Down Expand Up @@ -119,15 +124,17 @@ jobs:
popd
{% endfor %}

mkdir -p ${{ github.repository }}
pushd ${{ github.repository }}
REPO=${{ github.event.pull_request.head.repo.full_name || github.repository }}
SHA=${{ github.event.pull_request.head.sha || github.sha }}
mkdir -p $REPO
pushd $REPO
git init
git remote add origin ${{ github.server_url }}/${{ github.repository }}
git fetch origin ${{ github.sha }}
git remote add origin ${{ github.server_url }}/$REPO
git fetch origin $SHA
git reset --hard FETCH_HEAD
popd

cmake -G Ninja -S ${{ github.repository }} -B build \
cmake -G Ninja -S $REPO -B build \
{% for name in dependencies %}
{% set org, proj = name.split('/') %}
-D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/label-public-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Manage labels of pull requests that originate from forks
name: label-public-pr

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2

Loading