Skip to content

Commit

Permalink
Merge pull request #6 from maikebing/v1
Browse files Browse the repository at this point in the history
V1
  • Loading branch information
maikebing authored Jul 28, 2022
2 parents 45027e9 + 8e7f7a1 commit d197764
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: C/C++ CI

on:
push:
branches: [ "maikebing-patch-1" ]


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup RT-Thread
uses: maikebing/rt-thread_linux_env@maikebing-patch-1
with:
TARGET: 'mdk5'
CPPCHECK: '--enable=all --std=c99 applications/'

9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update -y && \
python3-pip python3-requests python-requests -y \
scons && \
apt-get clean -y
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 && \
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 && \
tar xf ./gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
mv gcc-arm-none-eabi-6_2-2016q4/ /opt/ && \
rm ./gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2 && \
Expand All @@ -20,7 +20,6 @@ RUN git clone https://git.code.sf.net/p/stm32flash/code stm32flash-code && \
stm32flash -h
RUN git clone https://github.com/RT-Thread/env.git /env/tools/scripts && \
git clone https://github.com/RT-Thread/packages.git /env/packages/packages
ENV PATH $PATH:/env/tools/scripts
RUN echo " if [ ! -d ~/.env ]; then ln /env ~/.env -s;fi" >> /etc/bash.bashrc
RUN sed -i -e 's/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=y/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=n/g' /env/tools/scripts/cmds/.config

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
23 changes: 23 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# action.yml
name: 'RT-Thread CI Action'
description: 'RT-Thread CI Action'
author: 'maikebing<mysticboy@live.com>'
branding:
icon: 'box'
color: 'blue'
inputs:
TARGET:
description: 'scons -target=?'
default: mdk5
required: true
CPPCHECK:
default: --enable=all --std=c99 applications/
required: false
description: 'cppcheck options'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.target }}
- ${{ inputs.std }}

21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
ln /env $HOME/.env -s
export PATH=$PATH:$HOME/.env/tools/scripts
sed -i -e 's/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=y/CONFIG_SYS_PKGS_DOWNLOAD_ACCELERATE=n/g' /env/tools/scripts/cmds/.config
if [ -r SConstruct ]; then
pkgs --printenv
pkgs --list
pkgs --update
if [ -z "${CPPCHECK}" ]; then
cppcheck ${CPPCHECK}
fi

if [-z "${TARGET}" ]; then
scons --target=${TARGET}
else
scons
fi
else
pkgs --help
echo "fogret checkout?"
fi

0 comments on commit d197764

Please sign in to comment.