Skip to content

Commit

Permalink
Remove other jobs while debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Mar 1, 2024
1 parent 73ef427 commit cdf77d1
Showing 1 changed file with 0 additions and 141 deletions.
141 changes: 0 additions & 141 deletions .github/workflows/check-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,144 +95,3 @@ jobs:
for (const wf of runInfo.referenced_workflows) {
core.notice(JSON.stringify(wf));
}
image-build:
name: Build image (repo2docker)
runs-on: ubuntu-latest
outputs:
image: ${{ steps.repo2docker.outputs.IMAGE_SHA_NAME }}
steps:

- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: repo2docker (no push)
uses: jupyterhub/repo2docker-action@b3cd89ff99f95b00abb5b4db27ec49bb4d3f8c85
if: inputs.container-registry == ''
id: repo2docker-no-push
with:
NO_PUSH: "true"
IMAGE_NAME: ${{ inputs.repository }}
MYBINDERORG_TAG: ${{ inputs.ref }}

- name: repo2docker (push)
uses: jupyterhub/repo2docker-action@b3cd89ff99f95b00abb5b4db27ec49bb4d3f8c85
if: inputs.container-registry
id: repo2docker
with:
NO_PUSH: "false"
DOCKER_REGISTRY: ${{ inputs.container-registry }}
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: ${{ inputs.repository }}
MYBINDERORG_TAG: ${{ inputs.ref }}

container-launch:
name: Test container launch
if: inputs.test-container
runs-on: ubuntu-latest
needs: [image-build]
steps:

- name: Run command to test built image ${{ needs.image-build.outputs.image }}
id: run
run: |
canary_command="ls -la"
docker run --name "${{ inputs.test-container }}" "${{ needs.image-build.outputs.image }}" $canary_command
- name: Copy artifacts from container
id: copy
run: |
stuff_to_copy="${{ inputs.build-artifacts }}"
container_working_dir=$(docker inspect --format '{{.Config.WorkingDir}}' "${{ inputs.test-container }}")
for file_or_dir in $stuff_to_copy
do
docker cp "${{ inputs.test-container }}:${container_working_dir}/${file_or_dir}" "./${file_or_dir}"
done
# delete container once done
docker rm --volumes "${{ inputs.test-container }}"
- name: Upload copied build artifacts
if: inputs.build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ inputs.build-artifacts }}
if-no-files-found: error
id: upload-build-artifacts

binder-cache:
runs-on: ubuntu-latest
if: inputs.binder-cache-branch
needs: [image-build]
outputs:
ref: ${{ steps.update-repo.outputs.branch-name }}
steps:

- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Update repo with Binder cache branch
id: update-repo
run: |
branch_name="${{ inputs.binder-cache-branch }}"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config --global push.autoSetupRemote true
git switch --force-create "$branch_name"
mkdir -p .binder
cat << 'EOF' > .binder/Dockerfile
FROM ${{ needs.image-build.outputs.image }}
EOF
git add .binder/Dockerfile
git commit -m "Update image tag"
git push -f
echo "branch-name=$branch_name" >> $GITHUB_OUTPUT
report:
name: Report status
needs: [image-build, container-launch, binder-cache]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:

- name: Report build failure
if: ${{ !( needs.image-build.result == 'success' && needs.container-launch.result == 'success') }}
run: |
cat << EOF > $GITHUB_STEP_SUMMARY
The CI run was not successful for ${{ inputs.repository }}@${{ inputs.ref }}.
See the following resources for details:
- <https://github.com/USRSE/usrse23/wiki/notebooks-submissions>
EOF
- name: Report build success
if: needs.image-build.result == 'success' && needs.container-launch.result == 'success'
run: |
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
The CI build was successful for ${{ inputs.repository }}@${{ inputs.ref }}!
EOF
- name: Add Binder launch (w/ cache)
if: needs.binder-cache.result == 'success'
run: |
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
[![Binder](https://mybinder.org/badge_logo.svg)](${{ inputs.binder-base-url }}/gh/${{ inputs.repository }}/${{ needs.binder-cache.outputs.ref }}) :point_left: Launch Binder from ${{ inputs.repository }}@${{ needs.binder-cache.outputs.ref }} (faster)
EOF
- name: Add Binder launch
run: |
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
[![Binder](https://mybinder.org/badge_logo.svg)](${{ inputs.binder-base-url }}/gh/${{ inputs.repository }}/${{ inputs.ref}}) :point_left: Launch Binder from ${{ inputs.repository }}@${{ inputs.ref }} (needs rebuild)
EOF

0 comments on commit cdf77d1

Please sign in to comment.