Skip to content

Commit

Permalink
Fix testing PR from repository fork
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Jun 17, 2024
1 parent c07d899 commit 1b1facc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,13 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Short commit SHA
id: short
run: |
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
SHORT_SHA=${SHA:0:7}
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Build and publish Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
WEBRCI_SHA=${{ steps.short.outputs.sha }}
WEBRCI_SHA=${{ github.sha }}
MAKE_LIBS_TARGET=all
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,31 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Short commit SHA
id: short
- name: Obtain git ref for PR
if: ${{ github.event.pull_request.head.sha != '' }}
run: |
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
SHORT_SHA=${SHA:0:7}
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
REPO="https://github.com/${{github.event.pull_request.head.repo.full_name}}.git"
echo "repo: $REPO"
echo "repo=$REPO" >> $GITHUB_OUTPUT
SHA="${{ github.event.pull_request.head.sha }}"
echo "sha: $SHA"
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Obtain git ref
if: ${{ github.event.pull_request.head.sha == '' }}
run: |
REPO="https://github.com/${{ github.repository }}.git"
echo "repo: $REPO"
echo "repo=$REPO" >> $GITHUB_OUTPUT
SHA="${{ github.sha }}"
echo "sha: $SHA"
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
build-args: |
WEBRCI_REPO=${{ steps.short.outputs.repo }}
WEBRCI_SHA=${{ steps.short.outputs.sha }}
MAKE_LIBS_TARGET=default
build-nix:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ RUN rig add 4.4.0 --without-pak
RUN /opt/R/current/bin/R -q -e 'install.packages("pak", lib = .Library)'

# Download webR and configure for LLVM flang
RUN git clone https://github.com/r-wasm/webr.git /opt/webr
ARG WEBRCI_REPO="https://github.com/r-wasm/webr.git"
RUN git clone ${WEBRCI_REPO} /opt/webr
WORKDIR /opt/webr
ARG WEBRCI_SHA=HEAD
RUN git checkout ${WEBRCI_SHA}
Expand Down

0 comments on commit 1b1facc

Please sign in to comment.