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

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

commit 90d22b703594f1c6ea4fb5562fce637a892f8bb2
Author: Michal Gorecki <[email protected]>
AuthorDate: Thu Jul 11 14:58:12 2024 +0200

    Add tests for allowed and ignored repos lists
---
 .github/newt_upgrade/allowed-ignored/expected.txt  |  7 ++++
 .github/newt_upgrade/allowed-ignored/project.yml   | 48 ++++++++++++++++++++++
 .../newt_upgrade/fail/core-ignored/expected.txt    |  1 +
 .github/newt_upgrade/fail/core-ignored/project.yml | 30 ++++++++++++++
 .../fail/core-not-allowed/expected.txt             |  1 +
 .../newt_upgrade/fail/core-not-allowed/project.yml | 31 ++++++++++++++
 .github/workflows/test_upgrade.yml                 | 28 +++++++++++++
 7 files changed, 146 insertions(+)

diff --git a/.github/newt_upgrade/allowed-ignored/expected.txt 
b/.github/newt_upgrade/allowed-ignored/expected.txt
new file mode 100644
index 00000000..683660be
--- /dev/null
+++ b/.github/newt_upgrade/allowed-ignored/expected.txt
@@ -0,0 +1,7 @@
+apache-mynewt-core
+apache-mynewt-mcumgr
+apache-mynewt-nimble
+arm-CMSIS_5
+mbedtls
+mcuboot
+nordic-nrfx
diff --git a/.github/newt_upgrade/allowed-ignored/project.yml 
b/.github/newt_upgrade/allowed-ignored/project.yml
new file mode 100644
index 00000000..a19d0874
--- /dev/null
+++ b/.github/newt_upgrade/allowed-ignored/project.yml
@@ -0,0 +1,48 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+project.repositories:
+   - apache-mynewt-core
+
+repository.apache-mynewt-core:
+   type: github
+   vers: 0-dev
+   user: apache
+   repo: mynewt-core
+
+repository.tinyusb:
+   type: github
+   vers: 0.0.0
+   user: hathach
+   repo: tinyusb
+
+project.repositories.allowed:
+   - apache-mynewt-core
+   - apache-mynewt-nimble
+   - apache-mynewt-mcumgr
+   - mcuboot
+   - arm-CMSIS_5
+   - nordic-nrfx
+   - mbedtls
+   - stm-cmsis_device_f3
+   - stm-stm32f3xx_hal_driver
+
+project.repositories.ignored:
+   - stm-cmsis_device_f3
+   - stm-stm32f3xx_hal_driver
diff --git a/.github/newt_upgrade/fail/core-ignored/expected.txt 
b/.github/newt_upgrade/fail/core-ignored/expected.txt
new file mode 100644
index 00000000..af5781a9
--- /dev/null
+++ b/.github/newt_upgrade/fail/core-ignored/expected.txt
@@ -0,0 +1 @@
+Error: apache-mynewt-core repository must be allowed. Please add it to the 
allowed list and/or remove it from the ignored list.
diff --git a/.github/newt_upgrade/fail/core-ignored/project.yml 
b/.github/newt_upgrade/fail/core-ignored/project.yml
new file mode 100644
index 00000000..98b4a532
--- /dev/null
+++ b/.github/newt_upgrade/fail/core-ignored/project.yml
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+project.repositories:
+   - apache-mynewt-core
+
+repository.apache-mynewt-core:
+   type: github
+   vers: 0-dev
+   user: apache
+   repo: mynewt-core
+
+project.repositories.ignored:
+   - apache-mynewt-core
diff --git a/.github/newt_upgrade/fail/core-not-allowed/expected.txt 
b/.github/newt_upgrade/fail/core-not-allowed/expected.txt
new file mode 100644
index 00000000..af5781a9
--- /dev/null
+++ b/.github/newt_upgrade/fail/core-not-allowed/expected.txt
@@ -0,0 +1 @@
+Error: apache-mynewt-core repository must be allowed. Please add it to the 
allowed list and/or remove it from the ignored list.
diff --git a/.github/newt_upgrade/fail/core-not-allowed/project.yml 
b/.github/newt_upgrade/fail/core-not-allowed/project.yml
new file mode 100644
index 00000000..588caf33
--- /dev/null
+++ b/.github/newt_upgrade/fail/core-not-allowed/project.yml
@@ -0,0 +1,31 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+project.repositories:
+   - apache-mynewt-core
+
+repository.apache-mynewt-core:
+   type: github
+   vers: 0-dev
+   user: apache
+   repo: mynewt-core
+
+project.repositories.allowed:
+   - apache-mynewt-nimble
+   - apache-mynewt-mcumgr
diff --git a/.github/workflows/test_upgrade.yml 
b/.github/workflows/test_upgrade.yml
index 9d2dc93c..8d20cf7f 100644
--- a/.github/workflows/test_upgrade.yml
+++ b/.github/workflows/test_upgrade.yml
@@ -100,3 +100,31 @@ jobs:
              echo "Checking target ${{ matrix.targets }}"
              ! newt upgrade &> tmp.txt
              cat tmp.txt | tail -n `wc -l < expected.txt` | diff -w 
expected.txt -
+
+  test_upgrade_filters:
+    name: newt upgrade (filters)
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, windows-latest, macos-latest]
+    runs-on: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v3
+      - uses: actions/setup-go@v3
+        with:
+          go-version: 'stable'
+      - name: Build newt
+        working-directory: newt
+        shell: bash
+        run: |
+          go version
+          go build
+          echo  ${GITHUB_WORKSPACE}/newt >> $GITHUB_PATH
+          git config --global url."https://github.com/".insteadOf 
"[email protected]:"
+      - name: Test upgrade allowed-ignored
+        shell: bash
+        working-directory: .github/newt_upgrade/allowed-ignored
+        run: |
+             echo "Test upgrade"
+             newt upgrade
+             ls repos | diff -w expected.txt -

Reply via email to