chenxuuu 3 роки тому
батько
коміт
4a673c6be1
1 змінених файлів з 64 додано та 0 видалено
  1. 64 0
      .github/workflows/esp32c3-idf5.yml

+ 64 - 0
.github/workflows/esp32c3-idf5.yml

@@ -0,0 +1,64 @@
+name: esp32c3-idf5
+
+on:
+  push:
+    paths:
+      - '.github/workflows/esp32c3-idf5.yml'
+      - 'lua/**'
+      - 'luat/**'
+      - 'components/**'
+  workflow_dispatch:
+  repository_dispatch:
+    types:
+      - webhook-esp32c3-idf5-action
+
+jobs:
+  build:
+    runs-on: ubuntu-20.04
+    steps:
+    - uses: actions/checkout@v1
+    - name: prepare software
+      run: |
+        sudo apt-get update
+        sudo apt-get install git gcc-multilib libc6 libgcc1 libstdc++5 libstdc++6 libsdl-dev p7zip-full python3 python3-pip libncurses5-dev -y
+        mkdir -p ~/esp
+        cd ~/esp
+        git clone --recursive https://github.com/espressif/esp-idf.git
+        cd ~/esp/esp-idf
+        git submodule update --init --recursive
+        ./install.sh esp32c3
+    - name: clone LuatOS-ESP32
+      run: |
+        sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
+        cd ..
+        retry 'git clone --branch=master https://gitee.com/openLuat/luatos-soc-idf5'
+    - name: build
+      run: |
+        mkdir luatosfw
+        cd ../luatos-soc-idf5/luatos
+        sed -i 's/E:\/\/code\/codeup\/LuatOS\//\/home\/runner\/work\/action\/LuatOS\//g' CMakeLists.txt
+        . ~/esp/esp-idf/export.sh
+        idf.py set-target esp32c3
+        idf.py build
+        mv *.soc ../../LuatOS/luatosfw
+    - name: Upload artifact
+      uses: actions/upload-artifact@v1
+      with:
+        name: esp32c3
+        path: luatosfw
+    - name: report if failure
+      if: always()
+      env:
+        STATUS: ${{ job.status }}
+        MQTTADDR: ${{ secrets.MQTTADDR }}
+        MQTTPORT: ${{ secrets.MQTTPORT }}
+        MQTTTOPIC: ${{ secrets.MQTTTOPIC }}
+        DD_APPKEY: ${{ secrets.DD_APPKEY }}
+        DD_APPSECRET: ${{ secrets.DD_APPSECRET }}
+        DD_NOTIFY_LIST: ${{ secrets.DD_NOTIFY_LIST }}
+        DD_API_TOKEN: ${{ secrets.DD_API_TOKEN }}
+        DD_API_SEND: ${{ secrets.DD_API_SEND }}
+      run: |
+        sudo pip3 install paho_mqtt gitpython requests
+        cd tools
+        if [ "$STATUS" = "failure" ];then python3 ciNotify.py $MQTTADDR $MQTTPORT $MQTTTOPIC "https://github.com/openLuat/LuatOS/actions/runs/$GITHUB_RUN_ID" "LuatOS-ESP32-IDF5" "$DD_APPKEY" "$DD_APPSECRET" "$DD_NOTIFY_LIST" "$DD_API_TOKEN" "$DD_API_SEND"; fi