]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: Pass the github.event_name to matrix.py
authorTim Duesterhus <tim@bastelstu.be>
Thu, 19 Nov 2020 23:16:00 +0000 (00:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 21 Nov 2020 10:05:16 +0000 (11:05 +0100)
This is a preparation to later run some matrix entries on schedule only.

Within the matrix.py script it can now be detected whether the workflow is
running on schedule by using:

    if build_type == "schedule":
        matrix.append(...)

.github/matrix.py
.github/workflows/vtest.yml

index c08f85040adad619ef602b859b6fa9d849edfa75..406218d0afcf0924072dde6cc97d8bb2a6b4c27f 100644 (file)
@@ -7,6 +7,15 @@
 # 2 of the License, or (at your option) any later version.
 
 import json
+import sys
+
+if len(sys.argv) == 2:
+    build_type = sys.argv[1]
+else:
+    print("Usage: {} <build_type>".format(sys.argv[0]), file=sys.stderr)
+    sys.exit(1)
+
+print("Generating matrix for type '{}'.".format(build_type))
 
 
 def clean_os(os):
index c88d4aac82cbe3c378350aeb0f712110ace2d98a..4d6fdfb6076b7c53572e9e2745e2637001134550 100644 (file)
@@ -23,7 +23,7 @@ jobs:
       - uses: actions/checkout@v2
       - name: Generate Build Matrix
         id: set-matrix
-        run: python3 .github/matrix.py
+        run: python3 .github/matrix.py "${{ github.event_name }}"
 
   # The Test job actually runs the tests.
   Test: