From 4c83013a40a6ffba72394e368a5b2aaaff7b98cd Mon Sep 17 00:00:00 2001 From: thread-liu Date: Thu, 3 Dec 2020 18:24:19 +0800 Subject: [PATCH] [update] change ci to github actions. --- .github/workflows/action.yml | 45 ++++++++++++++++++++++++++++++++++++ .travis.yml | 29 ----------------------- ci.py | 2 +- 3 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/action.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000000..1d50bd370e --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,45 @@ +name: RT-Thread_Packages + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + # Runs at 00:00 UTC on the 1, 16 and 31th of every month + schedule: + - cron: '0 0 */15 * *' + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@master + with: + python-version: 3.8 + + - name: Install Tools + shell: bash + run: | + sudo apt-get update && sudo apt-get install python-tk + sudo apt-get install scons rxvt-unicode + sudo apt-get -qq install gcc-multilib libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libsdl-dev || true + pip install requests + + - name: Packages check + shell: bash + run: | + BASE_ROOT=${{ github.workspace }} && cd .. && mkdir packages_temp && cp packages -R packages_temp && mv packages_temp packages && cd packages/packages_temp && echo "source \"\$PKGS_DIR/packages/Kconfig\"" > Kconfig + cd ${BASE_ROOT} && export PKGS_ROOT=${BASE_ROOT}/packages_temp && git clone --depth=1 --branch=master https://github.com/RT-Thread/rt-thread.git rt-thread && export RTT_ROOT=${BASE_ROOT}/rt-thread || true + cd ${RTT_ROOT}/tools/kconfig-frontends && scons || true + export TERM=xterm + cd ${RTT_ROOT}/bsp/qemu-vexpress-a9 && sudo -E ../../tools/kconfig-frontends/kconfig-mconf Kconfig -n + cp ${RTT_ROOT}/tools/kconfiglib.py ./ && python -c 'import kconfiglib; kconfiglib.standard_kconfig()' + cd ${PKGS_ROOT}/packages && python ci.py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 18feccfdc5..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: c - -notifications: - email: false - -before_script: -# travis has changed to 64-bit and we require 32-bit compatibility libraries - - "sudo apt-get update && sudo apt-get install python-tk" - - - "sudo apt-get install scons" - - - "sudo apt-get -qq install gcc-multilib libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libsdl-dev || true" - - - cd .. && BASE_ROOT=$(pwd) && mkdir packages_temp && mv packages packages_temp && cd packages_temp && echo "source \"\$PKGS_DIR/packages/Kconfig\"" > Kconfig - - - "cd ${BASE_ROOT} && export PKGS_ROOT=${BASE_ROOT}/packages_temp && git clone --depth=1 --branch=master https://github.com/RT-Thread/rt-thread.git rt-thread && export RTT_ROOT=${BASE_ROOT}/rt-thread || true" - - - "cd ${RTT_ROOT}/tools/kconfig-frontends && scons || true" - - - "cd ${RTT_ROOT}/bsp/qemu-vexpress-a9 && sudo ../../tools/kconfig-frontends/kconfig-mconf Kconfig -n" - - - "cp ${RTT_ROOT}/tools/kconfiglib.py ./ && python -c 'import kconfiglib; kconfiglib.standard_kconfig()'" - - - "cd ${PKGS_ROOT}/packages && python ci.py" - -script: - - echo success - diff --git a/ci.py b/ci.py index ce85f3af43..00c506aa5b 100644 --- a/ci.py +++ b/ci.py @@ -112,7 +112,7 @@ def json_file_content_check(package_info): print('The category of ' + package_info['name'] + ' package is lost.') return False - if package_info.has_key('enable') is False or package_info['enable'] == '': + if 'enable' not in package_info or package_info['enable'] == '': print('The enable of ' + package_info['name'] + ' package is lost.') return False