-
-
Notifications
You must be signed in to change notification settings - Fork 733
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1169 from Ralim/alpine
Migrating to Alpine build environment for CI and Dockerfile
- Loading branch information
Showing
5 changed files
with
76 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,31 +5,23 @@ on: [push, pull_request] | |
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: alpine:3.15 | ||
strategy: | ||
matrix: | ||
model: ["TS100", "TS80", "TS80P", "Pinecil", "MHP30"] | ||
fail-fast: true | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Install dependencies (apk) | ||
run: apk add --no-cache gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi findutils python3 py3-pip make git bash | ||
|
||
- name: chmod | ||
run: chmod +x setup.sh && chmod +x source/build.sh && sudo mkdir -p /build/cache && sudo chmod -R 777 /build | ||
- name: Install dependencies (python) | ||
run: python3 -m pip install bdflib | ||
|
||
- name: Cached compiler source files | ||
uses: actions/[email protected] | ||
env: | ||
cache-name: cache-compilers | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: /build/cache | ||
key: ${{ runner.os }}-build-${{ env.cache-name }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- name: setup | ||
run: ./setup.sh | ||
submodules: true | ||
|
||
- name: build ${{ matrix.model }} | ||
run: cd source && ./build.sh -m ${{ matrix.model }} | ||
|
@@ -52,32 +44,23 @@ jobs: | |
|
||
build_multi-lang: | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: alpine:3.15 | ||
strategy: | ||
matrix: | ||
model: ["Pinecil"] | ||
fail-fast: true | ||
|
||
steps: | ||
- name: Install dependencies (apk) | ||
run: apk add --no-cache gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi findutils python3 py3-pip make git bash musl-dev | ||
- name: Install dependencies (python) | ||
run: python3 -m pip install bdflib | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: chmod | ||
run: chmod +x setup.sh && chmod +x source/build.sh && sudo mkdir -p /build/cache && sudo chmod -R 777 /build | ||
|
||
- name: Cached compiler source files | ||
uses: actions/[email protected] | ||
env: | ||
cache-name: cache-compilers | ||
with: | ||
path: /build/cache | ||
key: ${{ runner.os }}-build-${{ env.cache-name }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- name: setup | ||
run: ./setup.sh | ||
|
||
- name: build ${{ matrix.model }} | ||
run: cd source && make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese | ||
|
||
|
@@ -142,6 +125,7 @@ jobs: | |
- name: setup | ||
run: sudo apt-get update && sudo apt-get install -y make clang git python3 python3-pip && python3 -m pip install bdflib black flake8 | ||
|
||
- name: Check formatting with clang-format | ||
run: cd source && make clean && make check-style | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
FROM ubuntu:20.04 | ||
FROM alpine:3.15 | ||
LABEL maintainer="Ben V. Brown <[email protected]>" | ||
|
||
WORKDIR /build | ||
# Add extra mirrors for options | ||
RUN echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal main restricted universe multiverse" > /etc/apt/sources.list && \ | ||
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \ | ||
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y ca-certificates | ||
# Install dependencies to build the firmware | ||
RUN apt-get install -y \ | ||
make \ | ||
bzip2 \ | ||
git \ | ||
python3 \ | ||
python3-pip \ | ||
clang-format \ | ||
dfu-util \ | ||
wget --no-install-recommends && \ | ||
apt-get clean | ||
RUN python3 -m pip install bdflib | ||
# Download the two compilers | ||
RUN wget -qO- "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" | tar -xj | ||
# This is the same as the one from Nuclei, just mirrored on Github as their download server is horrifically slow | ||
RUN wget -qO- "https://github.com/Ralim/nuclei-compiler/releases/download/2020.08/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2" | tar -xj | ||
# Installing the two compilers, python3, python3 pip, clang format | ||
# Compilders ->gcc-* newlib-* | ||
# Python3 -> py* | ||
# Misc -> findutils make git | ||
# musl-dev is required for the multi lang firmwares | ||
# clang is required for clang-format (for dev) | ||
|
||
RUN apk add --no-cache gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi findutils python3 py3-pip make git musl-dev clang bash | ||
|
||
# Install Python3 packages | ||
|
||
RUN python3 -m pip install bdflib black | ||
|
||
# Add compiler to the path | ||
ENV PATH "/build/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH" | ||
ENV PATH "/build/gcc/bin/:$PATH" | ||
COPY . /build/source | ||
COPY ./ci /build/ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*link: | ||
%(nano_link) %:replace-outfile(-lm_nano -lm) |