Consolidate CI jobs (#7697)
authorGereon Kremer <gkremer@stanford.edu>
Thu, 25 Nov 2021 04:31:09 +0000 (20:31 -0800)
committerGitHub <noreply@github.com>
Thu, 25 Nov 2021 04:31:09 +0000 (04:31 +0000)
This PR integrates the cancel and update-pr jobs into the main CI jobs. This not only looks nicer in the actions menu (less jobs) but also improves which jobs we cancel: this now also allows to cancel jobs in forks by getting rid of the magic workflow number.

.github/workflows/cancel.yml [deleted file]
.github/workflows/ci.yml
.github/workflows/update_pr.yml [deleted file]

diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
deleted file mode 100644 (file)
index 7f10763..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-on: [push, pull_request_target]
-name: Cancel
-
-jobs:
-  cancel:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Cancel Previous Runs
-        uses: styfle/cancel-workflow-action@0.5.0
-        with:
-          # cancel builds from ci workflow
-          workflow_id: 903674
-          access_token: ${{ github.token }}
index 723752eb8f1e244603c532f0aab94aa7cc5e8c9b..d2d69effe6d70b0a1011e6dd178b2f2bdc93932a 100644 (file)
@@ -2,6 +2,14 @@ on: [push, pull_request]
 name: CI
 
 jobs:
+  cancel:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Cancel Previous Runs
+        uses: styfle/cancel-workflow-action@0.5.0
+        with:
+          access_token: ${{ github.token }}
+
   build:
     strategy:
       matrix:
@@ -110,3 +118,16 @@ jobs:
       with:
         binary: ${{ steps.configure-and-build.outputs.static-build-dir }}/bin/cvc5
         github-token: ${{ secrets.GITHUB_TOKEN }}
+
+
+  update-pr:
+    runs-on: ubuntu-latest
+    needs: build
+    if: github.repository == 'cvc5/cvc5' && github.event == 'push'
+    steps:
+      - name: Automatically update PR
+        uses: adRise/update-pr-branch@v0.5.1
+        with:
+          token: ${{ secrets.ACTION_USER_TOKEN }}
+          base: 'master'
+          required_approval_count: 1
diff --git a/.github/workflows/update_pr.yml b/.github/workflows/update_pr.yml
deleted file mode 100644 (file)
index 3fab922..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-name: PR update
-
-on:
-  push:
-    branches:
-      - 'master'
-jobs:
-  autoupdate:
-    runs-on: ubuntu-latest
-    if: github.repository == 'cvc5/cvc5'
-    steps:
-      - name: Automatically update PR
-        uses: adRise/update-pr-branch@v0.5.1
-        with:
-          token: ${{ secrets.ACTION_USER_TOKEN }}
-          base: 'master'
-          required_approval_count: 1