forked from micropython/micropython-esp32-ulp
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (93 loc) · 3.09 KB
/
run_tests.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
#
# This file is part of the micropython-esp32-ulp project,
# https://github.com/micropython/micropython-esp32-ulp
#
# SPDX-FileCopyrightText: 2018-2023, the micropython-esp32-ulp authors, see AUTHORS file.
# SPDX-License-Identifier: MIT
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git build-essential libffi-dev pkg-config python3 bison flex xxd
- name: Record version
run: |
export VER=$(git describe --always --tags)
echo ${VER}
###### Install tools ######
- name: Build MicroPython
id: build_micropython
run: |
echo "Building micropython"
git clone --depth 1 https://github.com/micropython/micropython.git
pushd micropython/mpy-cross
make
popd
pushd micropython/ports/unix
git describe --always --tags
make submodules
make
export OUTDIR=$PWD/build-standard
export PATH=$PATH:$OUTDIR
echo "bin_dir=$OUTDIR" >> $GITHUB_OUTPUT
test $(micropython -c 'print("test")') = "test"
popd
- name: Fetch binutils-esp32ulp
id: fetch_binutils
run: |
echo "Fetching URL of pre-built esp32ulp-elf binaries"
## URL to pre-built binaries is published in esp-idf
IDFVER=v5.0.1
curl -s \
-o tools.json \
https://raw.githubusercontent.com/espressif/esp-idf/$IDFVER/tools/tools.json
URL=$(<tools.json jq -r '
.tools[]
| select(.name == "esp32ulp-elf").versions[]
| select(.status == "recommended")
| .["linux-amd64"]
| .url
// empty
')
echo "Downloading esp32ulp-elf from $URL"
curl -sL \
-o /tmp/esp32ulp-elf.tar.gz \
$URL
tar xfvz /tmp/esp32ulp-elf.tar.gz esp32ulp-elf/bin
export PATH=$PATH:$PWD/esp32ulp-elf/bin
echo "bin_dir=$PWD/esp32ulp-elf/bin" >> $GITHUB_OUTPUT
esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
###### Run tests ######
- name: Run unit tests
id: unit_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
cd tests
./00_unit_tests.sh
- name: Run compat tests
id: compat_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
export PATH=$PATH:${{ steps.fetch_binutils.outputs.bin_dir }}
cd tests
./01_compat_tests.sh
- name: Run compat tests with RTC macros
id: compat_rtc_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
export PATH=$PATH:${{ steps.fetch_binutils.outputs.bin_dir }}
cd tests
./02_compat_rtc_tests.sh
- name: Run disassembler tests
id: disassembler_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
cd tests
./03_disassembler_tests.sh