Test research template dev container #194
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
# This workflow tests that the dev container configuration within | |
# opensafely/research-template is correct with respect to the tests within | |
# `tests/dev_container.sh`. Notice that the dev container configuration lives in a | |
# different repository. This is because opensafely/research-template is a template | |
# repository; its contents are copied to multiple other repositories. Rather than test | |
# the dev container configuration in each of these multiple other repositories, we test | |
# it here, and assume that the copies don't deviate from the template repository. Doing | |
# so reduces the cost of updating the tests. | |
name: Test research template dev container | |
on: | |
schedule: | |
- cron: "18 8 * * *" | |
workflow_dispatch: | |
jobs: | |
dev-container: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout research-template repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'opensafely/research-template' | |
- name: Checkout research-template-docker repository in subdirectory | |
uses: actions/checkout@v4 | |
with: | |
path: 'research-template/research-template-docker' | |
- name: Test dev container | |
uses: devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8 # v0.3.1900000349 | |
with: | |
runCmd: ./research-template/research-template-docker/tests/dev_container.sh | |
- name: Notify Slack on failure | |
if: failure() && github.event_name == 'schedule' | |
uses: zuplo/github-action-slack-notify-build@cf8e7e66a21d76a8125ea9648979c30920195552 # v2 | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
with: | |
channel_id: C069SADHP1Q | |
status: "Scheduled dev container test run failure" | |
color: danger |