You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/01/27 21:25:36 UTC

[mynewt-newt] branch master updated: ci: Use dynamic matrix for tests

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new bc1c77f2 ci: Use dynamic matrix for tests
bc1c77f2 is described below

commit bc1c77f2e3f0b14701ad1db1800a0042b8c22282
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Fri Jan 27 22:06:30 2023 +0100

    ci: Use dynamic matrix for tests
    
    There is no need to sync workflows with test targets etc.
---
 .github/workflows/test_commands.yml |  3 ++-
 .github/workflows/test_dump.yml     | 17 +++++++++++++++--
 .github/workflows/test_upgrade.yml  | 23 ++++++++++++++++++++---
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/test_commands.yml b/.github/workflows/test_commands.yml
index 3a98eac1..f2c50724 100644
--- a/.github/workflows/test_commands.yml
+++ b/.github/workflows/test_commands.yml
@@ -17,12 +17,13 @@
 # under the License.
 #
 
-name: commands
+name: Test commands
 
 on: [push, pull_request]
 
 jobs:
   test_commands:
+    name: other
     strategy:
       fail-fast: false
       matrix:
diff --git a/.github/workflows/test_dump.yml b/.github/workflows/test_dump.yml
index f67adedb..e01bc298 100644
--- a/.github/workflows/test_dump.yml
+++ b/.github/workflows/test_dump.yml
@@ -17,16 +17,29 @@
 # under the License.
 #
 
-name: dump
+name: Test commands
 
 on: [push, pull_request]
 
 jobs:
+  populate-targets:
+    runs-on: ubuntu-latest
+    outputs:
+      targets: ${{ steps.set-matrix.outputs.targets }}
+    steps:
+      - uses: actions/checkout@v3
+      - id: set-matrix
+        shell: bash
+        run: |
+             echo "::set-output name=targets::$(ls .github/newt_dump/proj/targets/ | jq -R -s -c 'split("\n")[:-1]')"
+
   test_dump:
+    name: newt dump
+    needs: populate-targets
     strategy:
       fail-fast: false
       matrix:
-        targets: [bleprph-nrf52840pdk, boot-nrf52dk, btshell-nrf52840pdk, btshell-nrf52dk, my_blinky_sim]
+        targets: ${{ fromJson(needs.populate-targets.outputs.targets) }}
         os: [ubuntu-latest, windows-latest, macos-latest]
     runs-on: ${{ matrix.os }}
     steps:
diff --git a/.github/workflows/test_upgrade.yml b/.github/workflows/test_upgrade.yml
index e0c97ebf..4e4636a8 100644
--- a/.github/workflows/test_upgrade.yml
+++ b/.github/workflows/test_upgrade.yml
@@ -17,17 +17,32 @@
 # under the License.
 #
 
-name: upgrade
+name: Test commands
 
 on: [push, pull_request]
 
 jobs:
+  populate-projects:
+    runs-on: ubuntu-latest
+    outputs:
+      projects_success: ${{ steps.set-matrix.outputs.projects_success }}
+      projects_fail: ${{ steps.set-matrix.outputs.projects_fail }}
+    steps:
+      - uses: actions/checkout@v3
+      - id: set-matrix
+        shell: bash
+        run: |
+             echo "::set-output name=projects_success::$(ls .github/newt_upgrade/success/ | jq -R -s -c 'split("\n")[:-1]')"
+             echo "::set-output name=projects_fail::$(ls .github/newt_upgrade/fail/ | jq -R -s -c 'split("\n")[:-1]')"
+
   test_upgrade_success:
+    name: newt upgrade (success)
+    needs: populate-projects
     strategy:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]
-        projects: [basic01, basic02, basic03, branches01, dup-overrides, inferrc, one-override, three-overrides]
+        projects: ${{ fromJson(needs.populate-projects.outputs.projects_success) }}
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v3
@@ -57,11 +72,13 @@ jobs:
              newt info | grep mynewt-dummy | diff -w expected.txt -
 
   test_upgrade_fail:
+    name: newt upgrade (fail)
+    needs: populate-projects
     strategy:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]
-        projects: [conflict01, conflict02, nonexistent-commit, nonexistent-version]
+        projects: ${{ fromJson(needs.populate-projects.outputs.projects_fail) }}
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v3