Skip to content

Commit 0a9eeef

Browse files
committed
ci: Add basic Github Actions workflow
This runs newt test and samples build for nRF52840.
1 parent 5b3fd8e commit 0a9eeef

File tree

3 files changed

+170
-0
lines changed

3 files changed

+170
-0
lines changed

.github/project.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
project.name: "my_project"
21+
22+
project.repositories:
23+
- apache-mynewt-core
24+
25+
# Use github's distribution mechanism for core ASF libraries.
26+
# This provides mirroring automatically for us.
27+
#
28+
repository.apache-mynewt-core:
29+
type: github
30+
vers: 0.0.0
31+
user: apache
32+
repo: mynewt-core
33+
34+
project.repositories.allowed:
35+
- apache-mynewt-core
36+
- apache-mynewt-nimble
37+
- apache-mynewt-mcumgr
38+
- mcuboot
39+
- mbedtls
40+
- nordic-nrfx
41+
- arm-CMSIS_5
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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: Build check
21+
22+
on: [push, pull_request]
23+
24+
jobs:
25+
targets:
26+
name: Build GCC test target
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest]
31+
gcc: ['14.2.Rel1', '13.2.Rel1', '12.2.Rel1', '11.3.Rel1', '10.3-2021.10', '9-2020-q2', '8-2019-q3']
32+
runs-on: ${{ matrix.os }}
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-go@v3
36+
with:
37+
go-version: 'stable'
38+
- uses: carlosperate/[email protected]
39+
with:
40+
release: ${{ matrix.gcc }}
41+
- name: Install newt
42+
shell: bash
43+
run: |
44+
go version
45+
go install mynewt.apache.org/newt/newt@latest
46+
- name: Setup project
47+
shell: bash
48+
run: |
49+
newt new build
50+
cp -f .github/project.yml build/project.yml
51+
cd build
52+
newt upgrade --shallow=1
53+
rm -rf repos/apache-mynewt-mcumgr
54+
git clone .. repos/apache-mynewt-mcumgr
55+
cd ..
56+
- name: Build test target
57+
shell: bash
58+
run: |
59+
cd build
60+
newt target create cc_test1
61+
newt target set cc_test1 bsp="@apache-mynewt-core/hw/bsp/nordic_pca10056"
62+
newt target set cc_test1 app="@apache-mynewt-mcumgr/samples/omp_svr/mynewt"
63+
newt build -j 1 cc_test1
64+
newt target create cc_test2
65+
newt target set cc_test2 bsp="@apache-mynewt-core/hw/bsp/nordic_pca10056"
66+
newt target set cc_test2 app="@apache-mynewt-mcumgr/samples/smp_svr/mynewt"
67+
newt build -j 1 cc_test2
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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: Unit tests
21+
22+
on: [push, pull_request]
23+
24+
jobs:
25+
newt_test:
26+
name: Run newt test all
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, macos-13]
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+
- name: Install Dependencies
38+
if: matrix.os == 'ubuntu-latest'
39+
shell: bash
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y gcc-multilib
43+
- name: Install newt
44+
shell: bash
45+
run: |
46+
go version
47+
go install mynewt.apache.org/newt/newt@latest
48+
- name: Setup project
49+
shell: bash
50+
run: |
51+
newt new build
52+
cp -f .github/project.yml build/project.yml
53+
cd build
54+
newt upgrade --shallow=1
55+
rm -rf repos/apache-mynewt-mcumgr
56+
git clone .. repos/apache-mynewt-mcumgr
57+
cd ..
58+
- name: newt test all
59+
shell: bash
60+
run: |
61+
cd build
62+
newt test all

0 commit comments

Comments
 (0)