@@ -3,78 +3,82 @@ name: Build
33on : [push, pull_request]
44
55jobs :
6- build :
7- name : Build (and Release)
6+ binaries :
7+ name : Build Binaries
8+ strategy :
9+ matrix :
10+ target : [thumbv6m-none-eabi, thumbv7em-none-eabi, thumbv8m.main-none-eabi]
11+ start_address : [0x0802_0000, 0x1002_0000]
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+ with :
16+ submodules : true
17+ - run : |
18+ rustup target add ${{ matrix.target }}
19+ cargo nbuild binaries --target=${{ matrix.target }} --start-address=${{ matrix.start_address }}
20+ - name : Upload Artifacts
21+ uses : actions/upload-artifact@v4
22+ if : ${{success()}}
23+ with :
24+ name : ${{ matrix.target }}-${{ matrix.start_address }}-binaries
25+ if-no-files-found : error
26+ path : |
27+ ./target/${{ matrix.target }}/release/neotron-os
28+ linux-libraries :
829 runs-on : ubuntu-latest
930 steps :
1031 - name : Checkout
1132 uses : actions/checkout@v4
1233 with :
1334 submodules : true
14-
15- - name : Check Syntax
16- run : |
17- cargo check
18-
19- - name : Test
20- run : |
21- cargo test --lib
22-
23- - name : Install Targets and Tools
24- run : |
25- rustup toolchain install stable --profile minimal --no-self-update
26- rustup default stable
27- rustup target add thumbv7em-none-eabi
28- rustup target add thumbv7m-none-eabi
29- rustup target add thumbv6m-none-eabi
30- rustup component add llvm-tools-preview
31- echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
32- echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
33-
34- - name : Install tools
35- uses : taiki-e/install-action@v2
35+ - name : Build
36+ run : cargo nbuild libraries
37+ - name : Upload Artifacts
38+ uses : actions/upload-artifact@v4
39+ if : ${{success()}}
3640 with :
37- tool : cargo-binutils@0.3.6
38-
39- - name : Install ROMFS tools
40- run : |
41- cargo install neotron-romfs-lsfs
42- cargo install neotron-romfs-mkfs
43-
41+ name : linux-libraries
42+ if-no-files-found : error
43+ path : |
44+ ./target/release/libneotron_os.so
45+ windows-libraries :
46+ runs-on : windows-latest
47+ steps :
48+ - name : Checkout
49+ uses : actions/checkout@v4
50+ with :
51+ submodules : true
4452 - name : Build
45- run : |
46- ./build.sh --verbose
47-
53+ run : cargo nbuild libraries
4854 - name : Upload Artifacts
4955 uses : actions/upload-artifact@v4
5056 if : ${{success()}}
5157 with :
52- name : Artifacts
58+ name : windows-libraries
5359 if-no-files-found : error
5460 path : |
55- ./release/
56-
61+ ./target/release/neotron_os.dll
62+ run-tests :
63+ steps :
64+ - uses : actions/checkout@v4
65+ with :
66+ submodules : true
67+ - run : cargo nbuild test
68+ release :
69+ name : Upload Release
70+ needs : [binaries, linux-libraries, windows-libraries]
71+ if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
72+ steps :
73+ - name : Make release area
74+ run : |
75+ mkdir ./release
76+ - name : Download Artifacts
77+ uses : actions/download-artifact@v4
78+ with :
79+ path : ./release
5780 - name : Upload files to Release
58- if : github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
5981 uses : softprops/action-gh-release@v1
6082 with :
6183 files : |
62- ./release/thumbv6m-none-eabi-flash0002-libneotron_os.bin
63- ./release/thumbv6m-none-eabi-flash0002-libneotron_os.elf
64- ./release/thumbv6m-none-eabi-flash0802-libneotron_os.bin
65- ./release/thumbv6m-none-eabi-flash0802-libneotron_os.elf
66- ./release/thumbv6m-none-eabi-flash1002-libneotron_os.bin
67- ./release/thumbv6m-none-eabi-flash1002-libneotron_os.elf
68- ./release/thumbv7em-none-eabi-flash0002-libneotron_os.bin
69- ./release/thumbv7em-none-eabi-flash0002-libneotron_os.elf
70- ./release/thumbv7em-none-eabi-flash0802-libneotron_os.bin
71- ./release/thumbv7em-none-eabi-flash0802-libneotron_os.elf
72- ./release/thumbv7em-none-eabi-flash1002-libneotron_os.bin
73- ./release/thumbv7em-none-eabi-flash1002-libneotron_os.elf
74- ./release/thumbv7m-none-eabi-flash0002-libneotron_os.bin
75- ./release/thumbv7m-none-eabi-flash0002-libneotron_os.elf
76- ./release/thumbv7m-none-eabi-flash0802-libneotron_os.bin
77- ./release/thumbv7m-none-eabi-flash0802-libneotron_os.elf
78- ./release/thumbv7m-none-eabi-flash1002-libneotron_os.bin
79- ./release/thumbv7m-none-eabi-flash1002-libneotron_os.elf
80- ./release/x86_64-unknown-linux-gnu-libneotron_os.so
84+ ./release/*
0 commit comments