-
Notifications
You must be signed in to change notification settings - Fork 105
124 lines (109 loc) · 3.63 KB
/
pico-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# Copyright 2022 Paul Guyot <pguyot@kallisys.net>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: Pico Build
on:
push:
paths:
- '.github/workflows/pico-build.yaml'
- 'CMakeLists.txt'
- 'libs/**'
- 'src/platforms/rp2040/**'
- 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl'
- 'src/libAtomVM/**'
pull_request:
paths:
- '.github/workflows/pico-build.yaml'
- 'CMakeLists.txt'
- 'libs/**'
- 'src/platforms/rp2040/**'
- 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl'
- 'src/libAtomVM/**'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
pico:
runs-on: ubuntu-22.04
strategy:
matrix:
board: ["pico", "pico_w"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: "apt update"
run: sudo apt update
- name: "Install deps"
run: sudo apt install -y cmake gperf ninja-build gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib erlang-base erlang-dialyzer
- name: Build
shell: bash
working-directory: ./src/platforms/rp2040/
run: |
set -euo pipefail
mkdir build
cd build
cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }}
ninja
- name: Install nvm and nodejs 20
run: |
set -euo pipefail
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source $HOME/.nvm/nvm.sh
nvm install 20
- name: Build tests (without SMP)
shell: bash
working-directory: ./src/platforms/rp2040/
run: |
set -euo pipefail
mkdir build.nosmp
cd build.nosmp
# TODO: fix all warnings and enable -DAVM_WARNINGS_ARE_ERRORS=ON
cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }} -DAVM_DISABLE_SMP=1
cmake --build . --target=rp2040_tests
- name: Run tests with rp2040js
shell: bash
working-directory: ./src/platforms/rp2040/tests
run: |
set -euo pipefail
source $HOME/.nvm/nvm.sh
nvm use node
npm install
npx tsx run-tests.ts ../build.nosmp/tests/rp2040_tests.uf2 ../build.nosmp/tests/test_erl_sources/rp2040_test_modules.uf2
- name: Build atomvmlib.uf2
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
set -euo pipefail
mkdir build
cd build
cmake ..
make atomvmlib.uf2
- name: Rename and write sha256sum
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
pushd src/platforms/rp2040/build
ATOMVM_UF2=AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2
mv src/AtomVM.uf2 "src/${ATOMVM_UF2}"
sha256sum "src/${ATOMVM_UF2}" > "src/${ATOMVM_UF2}.sha256"
popd
pushd build/libs
ATOMVMLIB_FILE=atomvmlib-${{ github.ref_name }}.uf2
mv atomvmlib.uf2 "${ATOMVMLIB_FILE}"
sha256sum "${ATOMVMLIB_FILE}" > "${ATOMVMLIB_FILE}.sha256"
popd
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
fail_on_unmatched_files: true
files: |
src/platforms/rp2040/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2
src/platforms/rp2040/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256
build/libs/atomvmlib-${{ github.ref_name }}.uf2
build/libs/atomvmlib-${{ github.ref_name }}.uf2.sha256