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.
pull/1195/head
Brian Sperlongano 2021-08-27 08:16:48 -04:00 zatwierdzone przez GitHub
rodzic 1cea73cb7c
commit 4525ce6a84
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 44 dodań i 36 usunięć

38
.github/workflows/integrity.yml vendored 100644
Wyświetl plik

@ -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

Wyświetl plik

@ -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:
push:
@ -8,35 +8,6 @@ on:
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
performance:
name: Evaluate performance
runs-on: self-hosted

Wyświetl plik

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