Skip to content

Commit

Permalink
ci: add opam-rt branch lookup for the form of username/branchname
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Nov 27, 2024
1 parent 84a949f commit 9ebd9b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/scripts/main/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ if [ "$OPAM_TEST" = "1" ]; then
fi
cd $CACHE/opam-rt
git fetch origin
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && git ls-remote --exit-code origin "$GITHUB_PR_USER/$BRANCH" ; then
BRANCH=$GITHUB_PR_USER/$BRANCH
fi
if git ls-remote --exit-code origin $BRANCH ; then
if git branch | grep -q $BRANCH; then
git checkout $BRANCH
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ let main_test_job ~analyse_job ~build_linux_job ~build_windows_job:_ ~build_macO
let matrix = platform_ocaml_matrix ~fail_fast:false start_latests_ocaml in
let host = host_of_platform platform in
let ocamlv = "${{ matrix.ocamlv }}" in
job ~oc ~workflow ?section ~runs_on:(Runner [runner]) ~env:[("OPAM_TEST", "1")] ~matrix ~needs ("Test-" ^ name_of_platform platform)
job ~oc ~workflow ?section ~runs_on:(Runner [runner])
~env:[("OPAM_TEST", "1"); ("GITHUB_PR_USER", "${{ github.event.pull_request.user.login }}")]
~matrix ~needs ("Test-" ^ name_of_platform platform)
++ only_on MacOS (install_sys_packages ["coreutils"; "gpatch"] ~descr:"Install gnu coreutils" [MacOS])
++ checkout ()
++ only_on Linux (run "Install bubblewrap" ["sudo apt install bubblewrap"])
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ jobs:
fail-fast: false
env:
OPAM_TEST: 1
GITHUB_PR_USER: ${{ github.event.pull_request.user.login }}
steps:
- name: Checkout tree
uses: actions/checkout@v4
Expand Down Expand Up @@ -336,6 +337,7 @@ jobs:
fail-fast: false
env:
OPAM_TEST: 1
GITHUB_PR_USER: ${{ github.event.pull_request.user.login }}
steps:
- name: Install gnu coreutils
run: brew install coreutils gpatch
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ users)
## Github Actions
* Add a doc generation job under linux [#5349 @rjbou]
* Update the github action scripts now that homebrew renamed the GNU patch binary to gpatch [#6296 @kit-ty-kate]
* Add branch scheme `username/branch` for opam-rt specific branch to use [#6274 @rjbou]

## Doc
* Update the command to install opam to point to the new simplified url on opam.ocaml.org [#6226 @kit-ty-kate]
Expand Down

0 comments on commit 9ebd9b6

Please sign in to comment.