mirror of
https://github.com/certbot/certbot.git
synced 2026-07-26 07:39:52 +02:00
Related to https://github.com/certbot/certbot/issues/10581 Following up on #10631 and https://github.com/certbot/certbot/pull/10622, this PR converts the `nightly` [pipeline](https://dev.azure.com/certbot/certbot/_build?definitionId=5) from Azure to Github Actions. `schedule` and `workflow_dispatch` triggers only work on merged branches, not PRs. To see these tests running, I temporarily added a `push` trigger in commit [a2e9c43](https://github.com/certbot/certbot/pull/10634/commits/a2e9c4303e4a9549562aaa460f15787020f25d0d). You can see the results of those tests [here](https://github.com/certbot/certbot/actions/runs/25688414262). I did not split each file into its own commit this time because I feel like the general idea is clear. The relevant files in azure pipelines to reference are: - the deleted `.azure-pipelines/nightly.yml` --> `.github/workflows/nightly.yml` - `.azure-pipelines/templates/jobs/common-deploy-jobs.yml` --> `.github/workflows/deploy_docker_images.yml` and `.github/workflows/deploy_snaps.yml` - `.azure-pipelines/templates/stages/changelog-stage.yml` --> `.github/workflows/create_changelog.yml` I chose to split `common-deploy-jobs` into `deploy_docker_images` and `deploy_snaps`. This is because the docker arm32v6 build takes a long time, but uploading to docker is quick, while the armhf snaps build varies but is often quicker, but uploading the snaps can take some time. By splitting them, we can specify the dependencies more precisely, and hopefully shave some time off the total. Without the split, tests took [53 minutes total](https://github.com/certbot/certbot/actions/runs/25684264622). After the split, tests took [33 minutes total](https://github.com/certbot/certbot/actions/runs/25688414262)! As before, the "nightly deploy stage" from azure has been omitted for clarity. `rerun.yml` did not exist before. There's not a great built-in way to rerun individual jobs in github actions, which I wanted for the snap builds specifically, since other timeouts can still happen. I could have made an action or additional workflow and wrapped that in a script to retry it, but I figured actually it's nicer to have the ability to rerun anything. This is equivalent to clicking "rerun all failed jobs," which I feel is usually what we want. Unfortunately, I am pretty sure that to test it, the rerun script will need to be merged first, since it relies on `workflow_dispatch`. You can see that packages were successfully uploaded to [dockerhub](https://hub.docker.com/r/certbot/certbot/tags) and the [snap store](https://dashboard.snapcraft.io/stores/snaps/); looking at the timestamps is probably the easiest way to confirm (about 11:45am Monday).
121 lines
3.5 KiB
YAML
121 lines
3.5 KiB
YAML
# Nightly pipeline running each day for main.
|
|
name: Nightly build
|
|
on:
|
|
schedule:
|
|
- cron: 30 4 * * *
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
# While many of these jobs could be grouped in a separate workflow, the github actions UI
|
|
# is much nicer if they are instead listed explicitly here.
|
|
###########################
|
|
#### testing jobs ###
|
|
###########################
|
|
standard_tests_jobs:
|
|
name: Standard tests
|
|
permissions:
|
|
contents: read
|
|
uses: "./.github/workflows/standard_tests_jobs.yml"
|
|
extended_tests_jobs:
|
|
name: Extended tests
|
|
permissions:
|
|
contents: read
|
|
uses: "./.github/workflows/extended_tests_jobs.yml"
|
|
secrets:
|
|
AWS_TEST_FARM_PEM: "${{ secrets.AWS_TEST_FARM_PEM }}"
|
|
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
|
|
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
|
|
###########################
|
|
#### packaging jobs ###
|
|
###########################
|
|
docker_packaging_jobs:
|
|
name: Docker packaging
|
|
permissions:
|
|
contents: read
|
|
uses: "./.github/workflows/docker_packaging_jobs.yml"
|
|
with:
|
|
dockerTag: nightly
|
|
snap_packaging_jobs:
|
|
name: Snap packaging
|
|
permissions:
|
|
contents: read
|
|
uses: "./.github/workflows/snap_packaging_jobs.yml"
|
|
with:
|
|
snapBuildTimeout: 19800
|
|
secrets:
|
|
LAUNCHPAD_CREDENTIALS: "${{ secrets.LAUNCHPAD_CREDENTIALS }}"
|
|
create_changelog:
|
|
name: Create changelog
|
|
permissions:
|
|
contents: read
|
|
uses: "./.github/workflows/create_changelog.yml"
|
|
############################
|
|
#### deploy jobs ###
|
|
############################
|
|
docker_deploy_jobs:
|
|
name: Deploy docker images
|
|
permissions:
|
|
contents: read
|
|
needs:
|
|
- standard_tests_jobs
|
|
- extended_tests_jobs
|
|
- docker_packaging_jobs
|
|
uses: "./.github/workflows/deploy_docker_images.yml"
|
|
secrets:
|
|
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
|
|
with:
|
|
dockerTag: nightly
|
|
snap_deploy_jobs:
|
|
name: Deploy snaps
|
|
permissions:
|
|
contents: read
|
|
needs:
|
|
- standard_tests_jobs
|
|
- extended_tests_jobs
|
|
- snap_packaging_jobs
|
|
uses: "./.github/workflows/deploy_snaps.yml"
|
|
secrets:
|
|
SNAPCRAFTCFG: "${{ secrets.SNAPCRAFTCFG }}"
|
|
with:
|
|
snapReleaseChannel: edge
|
|
############################
|
|
#### rerun job ###
|
|
############################
|
|
re-run:
|
|
name: Re-run
|
|
needs:
|
|
- standard_tests_jobs
|
|
- extended_tests_jobs
|
|
- docker_packaging_jobs
|
|
- snap_packaging_jobs
|
|
- create_changelog
|
|
- docker_deploy_jobs
|
|
- snap_deploy_jobs
|
|
if: failure() && fromJSON(github.run_attempt) < 3
|
|
permissions:
|
|
actions: write
|
|
checks: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- env:
|
|
GH_REPO: ${{ github.repository }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_DEBUG: api
|
|
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}
|
|
shell: bash
|
|
###########################
|
|
#### notify ###
|
|
###########################
|
|
notify:
|
|
name: Notify
|
|
needs:
|
|
- re-run
|
|
# Returns true when any previous step of a job fails. If you have a chain of dependent
|
|
# jobs, failure() returns true if any ancestor job fails.
|
|
if: failure() && (needs.re-run.result == 'skipped' || needs.re-run.result == 'failure')
|
|
uses: "./.github/workflows/notify_nightly.yml"
|
|
permissions:
|
|
actions: read
|
|
secrets:
|
|
MATTERMOST_PUBLIC_CERTBOT_CHANNEL_WEBHOOK: "${{ secrets.MATTERMOST_PUBLIC_CERTBOT_CHANNEL_WEBHOOK }}"
|