Skip to content

Commit d197764

Browse files
authored
Merge pull request #6 from maikebing/v1
V1
2 parents 45027e9 + 8e7f7a1 commit d197764

File tree

4 files changed

+67
-5
lines changed

4 files changed

+67
-5
lines changed

.github/workflows/docker-image.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ "maikebing-patch-1" ]
6+
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Setup RT-Thread
15+
uses: maikebing/rt-thread_linux_env@maikebing-patch-1
16+
with:
17+
TARGET: 'mdk5'
18+
CPPCHECK: '--enable=all --std=c99 applications/'
19+

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update -y && \
99
python3-pip python3-requests python-requests -y \
1010
scons && \
1111
apt-get clean -y
12-
RUN cd /tmp/ && wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
12+
RUN cd /tmp/ && wget -q https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
1313
tar xf ./gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
1414
mv gcc-arm-none-eabi-6_2-2016q4/ /opt/ && \
1515
rm ./gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
@@ -20,7 +20,6 @@ RUN git clone https://git.code.sf.net/p/stm32flash/code stm32flash-code && \
2020
stm32flash -h
2121
RUN git clone https://github.com/RT-Thread/env.git /env/tools/scripts && \
2222
git clone https://github.com/RT-Thread/packages.git /env/packages/packages
23-
ENV PATH $PATH:/env/tools/scripts
24-
RUN echo " if [ ! -d ~/.env ]; then ln /env ~/.env -s;fi" >> /etc/bash.bashrc
25-
RUN sed -i -e 's/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=y/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=n/g' /env/tools/scripts/cmds/.config
26-
23+
COPY entrypoint.sh /entrypoint.sh
24+
RUN chmod +x /entrypoint.sh
25+
ENTRYPOINT ["/entrypoint.sh"]

action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# action.yml
2+
name: 'RT-Thread CI Action'
3+
description: 'RT-Thread CI Action'
4+
author: 'maikebing<[email protected]>'
5+
branding:
6+
icon: 'box'
7+
color: 'blue'
8+
inputs:
9+
TARGET:
10+
description: 'scons -target=?'
11+
default: mdk5
12+
required: true
13+
CPPCHECK:
14+
default: --enable=all --std=c99 applications/
15+
required: false
16+
description: 'cppcheck options'
17+
runs:
18+
using: 'docker'
19+
image: 'Dockerfile'
20+
args:
21+
- ${{ inputs.target }}
22+
- ${{ inputs.std }}
23+

entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
ln /env $HOME/.env -s
3+
export PATH=$PATH:$HOME/.env/tools/scripts
4+
sed -i -e 's/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=y/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=n/g' /env/tools/scripts/cmds/.config
5+
if [ -r SConstruct ]; then
6+
pkgs --printenv
7+
pkgs --list
8+
pkgs --update
9+
if [ -z "${CPPCHECK}" ]; then
10+
cppcheck ${CPPCHECK}
11+
fi
12+
13+
if [-z "${TARGET}" ]; then
14+
scons --target=${TARGET}
15+
else
16+
scons
17+
fi
18+
else
19+
pkgs --help
20+
echo "fogret checkout?"
21+
fi

0 commit comments

Comments
 (0)