Skip to content

Commit 15c4ac6

Browse files
committed
ci: Add ambiguous config test
1 parent 4e78dbe commit 15c4ac6

File tree

7 files changed

+102
-0
lines changed

7 files changed

+102
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pkg.name: "targets/ambiguous_fail"
2+
pkg.type: target
3+
pkg.description:
4+
pkg.author:
5+
pkg.homepage:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syscfg.vals:
2+
SHELL_PROMPT_MODULE: 1
3+
SHELL_TASK: 1
4+
5+
syscfg.vals.SHELL_PROMPT_MODULE:
6+
CONSOLE_IMPLEMENTATION: stub
7+
8+
# This should fail
9+
syscfg.vals.SHELL_TASK:
10+
CONSOLE_IMPLEMENTATION: full
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target.app: "@apache-mynewt-nimble/apps/btshell"
2+
target.bsp: "@apache-mynewt-core/hw/bsp/nordic_pca10056"
3+
target.build_profile: optimized
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pkg.name: "targets/ambiguous_success"
2+
pkg.type: target
3+
pkg.description:
4+
pkg.author:
5+
pkg.homepage:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syscfg.vals:
2+
SHELL_PROMPT_MODULE: 1
3+
SHELL_TASK: 1
4+
5+
syscfg.vals.SHELL_PROMPT_MODULE:
6+
CONSOLE_IMPLEMENTATION: stub
7+
8+
# This should not fail as it sets the same value as previous conditional config
9+
syscfg.vals.SHELL_TASK:
10+
CONSOLE_IMPLEMENTATION: stub
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target.app: "@apache-mynewt-nimble/apps/btshell"
2+
target.bsp: "@apache-mynewt-core/hw/bsp/nordic_pca10056"
3+
target.build_profile: optimized
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Test ambiguous config
21+
22+
on: [push, pull_request]
23+
24+
jobs:
25+
test_ambiguous_cfg:
26+
name: other
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, windows-latest, macos-latest]
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: actions/setup-go@v3
35+
with:
36+
go-version: 'stable'
37+
- uses: carlosperate/arm-none-eabi-gcc-action@48db4484a55750df7a0ccca63347fcdea6534d78
38+
with:
39+
release: '12.2.Rel1'
40+
- name: Install Dependencies
41+
if: matrix.os == 'ubuntu-latest'
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y gcc-multilib
45+
- name: Build newt
46+
working-directory: newt
47+
shell: bash
48+
run: |
49+
go version
50+
go build
51+
echo ${GITHUB_WORKSPACE}/newt >> $GITHUB_PATH
52+
- name: Test ambiguous cfg (success)
53+
shell: bash
54+
run: |
55+
newt new project
56+
cp -r .github/targets/ambiguous_success project/targets
57+
cd project/
58+
newt upgrade -v
59+
newt build ambiguous_success
60+
- name: Test ambiguous cfg (fail)
61+
shell: bash
62+
run: |
63+
cp -r .github/targets/ambiguous_fail project/targets
64+
cd project/
65+
! newt build ambiguous_fail &> tmp.txt
66+
grep "Error: Setting CONSOLE_IMPLEMENTATION collision - two conditions true:" tmp.txt -q

0 commit comments

Comments
 (0)