diff --git a/.github/actions/phoenix-build/action.yml b/.github/actions/phoenix-build/action.yml index 696ad6fe..9ee03b47 100644 --- a/.github/actions/phoenix-build/action.yml +++ b/.github/actions/phoenix-build/action.yml @@ -29,6 +29,10 @@ inputs: description: 'Build additional tests' default: false required: false + libphoenix_nopic: + description: 'LIBPHOENIX_NOPIC' + default: 'n' + required: false # action runner runs: @@ -41,6 +45,7 @@ runs: SYSPAGE: ${{ inputs.syspage }} CI_CUSTOM_BUILDROOT: ${{ inputs.buildroot }} LONG_TEST: ${{ inputs.nightly == 'true' && 'y' || 'n' }} + LIBPHOENIX_NOPIC: ${{ inputs.libphoenix_nopic }} args: - ${{ inputs.params }} # note: params will be split by build.sh internally diff --git a/.github/workflows/ci-project-zed.yml b/.github/workflows/ci-project-zed.yml new file mode 100644 index 00000000..131ed1b7 --- /dev/null +++ b/.github/workflows/ci-project-zed.yml @@ -0,0 +1,380 @@ +# vim:sw=2:ts=2 +name: ci-project + +# on events +on: + workflow_call: + secrets: + CI_BOT_EMAIL_USERNAME: + required: false + CI_BOT_EMAIL_PASSWORD: + required: false + inputs: + build_params: + type: string + description: "parameters to build.sh script" + default: 'host core fs test project image' # by default don't build ports + required: false + nightly: + type: boolean + default: false + required: false + libphoenix_nopic: + type: string + default: 'n' + required: false + + +# jobs +jobs: + build: + name: build + runs-on: ubuntu-latest + outputs: + build_result: ${{ steps.build.outcome }} + strategy: + matrix: + # target: ['armv7a7-imx6ull-evk', 'armv7a9-zynq7000-qemu', 'armv7a9-zynq7000-zedboard', 'armv7a9-zynq7000-zturn', 'armv7m4-stm32l4x6-nucleo', 'armv7m7-imxrt105x-evk', 'armv7m7-imxrt106x-evk', 'armv7m7-imxrt117x-evk', 'host-generic-pc', 'ia32-generic-pc', 'ia32-generic-qemu', 'riscv64-generic-qemu', 'riscv64-generic-spike', 'sparcv8leon3-gr716-mini'] + target: ['armv7a9-zynq7000-zedboard'] + # include: + # - target: 'ia32-generic-qemu' + # syspage: 'psh pc-ata uart16550' + # - target: 'armv7a9-zynq7000-qemu' + # additional_params: 'ports' + steps: + # step 1: checkout repository code inside the workspace directory of the runner + - name: Checkout the repository + uses: actions/checkout@v3 + with: + submodules: recursive + + # attach GCC problem matcher - will pin problems to files only in current submodule + - uses: ammaraskar/gcc-problem-matcher@master + + # step 2: use our custom action to build the project + - name: Build + id: build + uses: ./.github/actions/phoenix-build + with: + target: ${{ matrix.target }} + syspage: ${{ matrix.syspage }} + params: ${{ inputs.build_params }} ${{ matrix.additional_params }} + nightly: ${{ inputs.nightly }} + libphoenix_nopic: ${{ inputs.libphoenix_nopic }} + + # step 3: tar rootfs + - name: Tar rootfs + working-directory: _fs + run: tar -cvf ../rootfs-${{ matrix.target }}.tar ${{ matrix.target }}/root + + # step 4: upload project boot directory and tarball of rootfs as build artifacts + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: phoenix-rtos-${{ matrix.target }} + path: | + _boot/${{ matrix.target }} + rootfs-${{ matrix.target }}.tar + + # test-emu: + # needs: build + # name: test EMU + # runs-on: ubuntu-latest + # outputs: + # runner_result: ${{ steps.runner.outcome }} + # strategy: + # fail-fast: false + # matrix: + # target: ['armv7a9-zynq7000-qemu', 'host-generic-pc', 'ia32-generic-qemu', 'riscv64-generic-qemu'] + + # steps: + # - name: Checkout the repository + # uses: actions/checkout@v3 + # with: + # submodules: recursive + + # - name: Download build artifacts + # uses: actions/download-artifact@v3 + # with: + # name: phoenix-rtos-${{ matrix.target }} + + # - name: Untar rootfs + # working-directory: _fs + # run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + # - name: Add sanitizers problem matcher + # run: echo "::add-matcher::.github/problem-matchers/sanitizer-errors.json" + + # - name: Test runner + # id: runner + # uses: ./.github/actions/phoenix-runner + # with: + # target: ${{ matrix.target }} + # nightly: ${{ inputs.nightly }} + + # - name: Upload runner results + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: test-results-${{ matrix.target }} + # path: | + # results.csv + # results.xml + + test-hw: + needs: build + name: test HW + runs-on: ${{ matrix.target }} + outputs: + runner_result: ${{ steps.runner.outcome }} + strategy: + fail-fast: false + matrix: + # target: ['armv7a7-imx6ull-evk', 'armv7m7-imxrt106x-evk', 'armv7m7-imxrt117x-evk', 'armv7a9-zynq7000-zedboard', 'armv7m4-stm32l4x6-nucleo'] + target: ['armv7a9-zynq7000-zedboard'] + + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: phoenix-rtos-${{ matrix.target }} + + - name: Untar rootfs-1 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-1 + id: runner-1 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-1 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-1 + path: | + results.csv + results.xml + + - name: Remofe rootfs-1 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-2 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-2 + id: runner-2 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-2 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-2 + path: | + results.csv + results.xml + + - name: Remofe rootfs-2 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-3 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-3 + id: runner-3 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-3 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-3 + path: | + results.csv + results.xml + + - name: Remofe rootfs-3 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-4 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-4 + id: runner-4 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-4 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-4 + path: | + results.csv + results.xml + + - name: Remofe rootfs-4 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-5 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-5 + id: runner-5 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-5 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-5 + path: | + results.csv + results.xml + + - name: Remofe rootfs-5 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-6 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-6 + id: runner-6 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-6 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-6 + path: | + results.csv + results.xml + + - name: Remofe rootfs-6 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-7 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-7 + id: runner-7 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-7 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-7 + path: | + results.csv + results.xml + + - name: Remofe rootfs-7 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + - name: Untar rootfs-8 + working-directory: _fs + run: tar -xvf ../rootfs-${{ matrix.target }}.tar + + - name: Test runner-8 + id: runner-8 + run: | + python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv + + - name: Upload runner results-8 + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-results-${{ matrix.target }}-8 + path: | + results.csv + results.xml + + - name: Remofe rootfs-8 + working-directory: _fs + run: rm -rf ${{ matrix.target }} + + # I Abarot + + tests-summary: + if: success() || failure() # don't care about cancelled runs + # needs: ['test-emu', 'test-hw'] + needs: ['test-hw'] + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + # FIXME: download-artifact don't support downloading artifacts by wildcard, download all artifacts for now + with: + path: artifacts + + - name: Display structure of downloaded files + run: ls -R + + - name: Merge Test Results + run: | + pip3 install junitparser junit2html + junitparser merge artifacts/test-results-*/results.xml junit.xml + junit2html junit.xml junit.html + + - name: Upload Merged Unit Test Results in HTML + uses: actions/upload-artifact@v3 + with: + name: Merged Unit Test Results + if-no-files-found: ignore + path: | + junit.html + junit.xml + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + check_name: Unit Test Results + files: "junit.xml" + + + # send-notification: + # needs: ['build', 'test-emu', 'test-hw'] + # if: failure() && github.event_name != 'pull_request' + # uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/_send_google_chat.yml@master + # secrets: inherit diff --git a/.github/workflows/ci-project.yml b/.github/workflows/ci-project.yml index 724d59a1..f09a247f 100644 --- a/.github/workflows/ci-project.yml +++ b/.github/workflows/ci-project.yml @@ -19,6 +19,10 @@ on: type: boolean default: false required: false + libphoenix_nopic: + type: string + default: 'n' + required: false # jobs @@ -55,6 +59,7 @@ jobs: syspage: ${{ matrix.syspage }} params: ${{ inputs.build_params }} ${{ matrix.additional_params }} nightly: ${{ inputs.nightly }} + libphoenix_nopic: ${{ inputs.libphoenix_nopic }} # step 3: tar rootfs - name: Tar rootfs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af5d919b..95d201fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,10 @@ on: - 'feature/*' jobs: - call-ci: - uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/ci-project.yml@master + pic-3: + uses: ./.github/workflows/ci-project-zed.yml + with: + nightly: true + build_params: all tests + libphoenix_nopic: n secrets: inherit diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index aacc25f5..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,100 +0,0 @@ -# vim:sw=2:ts=2 -# static linters which can be run in a single repo (do not need phoenix-rtos-project) -name: lint - -# on events -on: - push: - branches: - - master - - 'feature/*' - pull_request: - branches: - - master - - 'feature/*' - workflow_call: # reusable workflow - the same jobs in submodules - -jobs: - clang-format: - if: github.event_name == 'push' - name: clang-format - runs-on: ubuntu-latest - steps: - - name: Checkout current repo - uses: actions/checkout@v3 - with: - fetch-depth: 3 # current PR merge commit + 1 back - - - uses: reviewdog/action-setup@v1 - if: false - - # upstream reviewdog doesn't work for now, sideload our static binary - - name: Install reviewdog - run: | - wget http://misc.nalajcie.org/reviewdog -O /tmp/reviewdog 2>/dev/null - chmod +x /tmp/reviewdog - - - name: clang-format - if: true - shell: bash # will enforce -o pipefail - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git diff -U0 HEAD^ | clang-format-diff-15 -p1 | /tmp/reviewdog -f=diff -f.diff.strip=0 -name=clang-format -reporter=github-check - - # reviewdog: use clang-format for PR review - clang-format-pr: - if: github.event_name == 'pull_request' - name: clang-format-pr - runs-on: ubuntu-latest - steps: - - name: Checkout current repo - uses: actions/checkout@v3 - with: - fetch-depth: 2 # current PR merge commit + 1 back - - - uses: reviewdog/action-setup@v1 - if: false - - # upstream reviewdog doesn't work for now, sideload our static binary - - name: Install reviewdog - run: | - wget http://misc.nalajcie.org/reviewdog -O /tmp/reviewdog 2>/dev/null - chmod +x /tmp/reviewdog - - - name: clang-format - shell: bash # will enforce -o pipefail - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git diff -U0 HEAD^ | clang-format-diff-15 -p1 | /tmp/reviewdog -f=diff -f.diff.strip=0 -name=clang-format-pr -reporter=github-pr-review -fail-on-error - - # reviewdog: codespell for PRs only - codespell-pr: - if: github.event_name == 'pull_request' - name: codespell-pr - runs-on: ubuntu-latest - steps: - - name: Checkout current repo - uses: actions/checkout@v3 - with: - fetch-depth: 2 # current PR merge commit + 1 back - - - name: codespell - uses: nalajcie/action-codespell@master - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review - - - # reviewdog: shellcheck - shellcheck-pr: - if: github.event_name == 'pull_request' - name: shellcheck-pr - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: reviewdog/action-shellcheck@v1 - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review diff --git a/libphoenix b/libphoenix index bfb6d463..965fe3c2 160000 --- a/libphoenix +++ b/libphoenix @@ -1 +1 @@ -Subproject commit bfb6d463cc1dae2f9a2fc16ed08e927cc0b53171 +Subproject commit 965fe3c2659f1384c8e8f8c6c6033ce06071b0a2