Vagrant Up #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Vagrant Up | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
vagrant-up: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Installing this is skipped in CI as using it was causing some corruption in | |
# attempting to mount the shared folder. The guest and host guest additions | |
# versions are close enough that we are fine without it. | |
# - run: vagrant plugin install vagrant-vbguest | |
- run: NO_SUBMISSIONS=1 vagrant up ubuntu-22.04 | |
- name: Validate image | |
run: curl --show-error --fail --include http://localhost:1511 | |
- name: Acquire Job ID | |
if: failure() | |
id: get-job-id | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
jobs=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs) | |
job_id=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .id') | |
echo "job_id=$job_id" >> $GITHUB_OUTPUT | |
- name: Send slack message on failure | |
if: failure() | |
run: | | |
curl -X POST -H "Content-type: application/json" --data '{"text":"The Vagrant Up Github Action has failed. View here: https://github.com/Submitty/Submitty/actions/runs/${{ github.run_id }}/job/${{ steps.get-job-id.outputs.job_id }}"}' ${{ secrets.VAGRANT_UP_WEBHOOK }} | |
curl -X POST https://submitty.zulipchat.com/api/v1/messages -u ${{ secrets.ZULIP_AUTHENTICATION }} --data-urlencode 'type=stream' --data-urlencode 'to=Submitty Developer Studio' --data-urlencode 'topic=Vagrant Up Failures' --data-urlencode 'content=The Vagrant Up Github Action has failed. View here: https://github.com/Submitty/Submitty/actions/runs/${{ github.run_id }}/job/${{ steps.get-job-id.outputs.job_id }}' |