Convert CI to use workflow triggers (#1189)

Fixes #948 

This PR does the following:
1. Changes the trigger for the PR comment updater from the cron method to workflow_run, triggered on completion of the test cases.  This should remove the delay between the completion of the performance tests and the updating of the corresponding comment in the PR.
2. Separates the integrity check and performance check into separate workflows and allows them to run in parallel.  This will allow the project to take advantage of multiple CI runners if they're available (which appears to be the case).

In addition, this fixes an issue with post-merge undeleted/updated branches on PRs.  The current "cron" method causes the CI to run the pr-update job over and over forever, unnecessarily.

As described in github/docs#799, and the [github docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run), a `workflow_run` trigger will only fire when the workflow file is on the main branch.  Thus, this change will not fire the PR updater on this PR.  Thus there's no way to test this working properly without merging onto master and then testing on one of the other PRs.
This commit is contained in:
Brian Sperlongano 2021-08-27 08:16:48 -04:00 committed by GitHub
parent 1cea73cb7c
commit 4525ce6a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 36 deletions

38
.github/workflows/integrity.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# Workflow to run basic integrity checks on OMT`s new Pull Requests and commits pushed into OMT repo
name: OpenMapTiles Integrity CI
on:
push:
branches: [ master, master-tools ]
pull_request:
jobs:
integrity_test:
name: Run integrity test
runs-on: ubuntu-latest
steps:
- name: Checkout the changes
uses: actions/checkout@v2
- name: Run quickstart for a small area
env:
area: monaco
MIN_ZOOM: 0
MAX_ZOOM: 14
QUIET: 1
run: |
./quickstart.sh $area
- name: Save quickstart.log
uses: actions/upload-artifact@v2
with:
name: quickstart.log
path: quickstart.log
- name: Test etldoc images
run: |
export TEST_MODE=yes
make generate-devdoc

View File

@ -1,6 +1,6 @@
# Workflow to validate OMT`s new Pull Requests and commits pushed into OMT repo # Workflow to run performance tests OMT`s new Pull Requests and commits pushed into OMT repo
name: OpenMapTiles CI name: OpenMapTiles Performance CI
on: on:
push: push:
@ -8,35 +8,6 @@ on:
pull_request: pull_request:
jobs: jobs:
integrity_test:
name: Run integrity test
runs-on: ubuntu-latest
steps:
- name: Checkout the changes
uses: actions/checkout@v2
- name: Run quickstart for a small area
env:
area: monaco
MIN_ZOOM: 0
MAX_ZOOM: 14
QUIET: 1
run: |
./quickstart.sh $area
- name: Save quickstart.log
uses: actions/upload-artifact@v2
with:
name: quickstart.log
path: quickstart.log
- name: Test etldoc images
run: |
export TEST_MODE=yes
make generate-devdoc
performance: performance:
name: Evaluate performance name: Evaluate performance
runs-on: self-hosted runs-on: self-hosted

View File

@ -1,15 +1,14 @@
name: Update PR comments name: Update PR comments
on: on:
# This number should correspond to the IGNORE_RUNS_OLDER_THAN value below. workflow_run:
# When setting up for the first time, use "on: push" instead of "on: schedule" workflows: ["OpenMapTiles Performance CI"]
# and set IGNORE_RUNS_OLDER_THAN to a very high number until it runs once. types: [completed]
schedule:
- cron: '*/6 * * * *'
jobs: jobs:
update_PRs: update_PRs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps: steps:
- name: main - name: main