This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ports' # by default don't build ports | ||
required: false | ||
nightly: | ||
type: boolean | ||
default: true | ||
required: false | ||
# jobs | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build_result: ${{ steps.build.outcome }} | ||
strategy: | ||
matrix: | ||
target: ['armv7a9-zynq7000-zedboard'] | ||
steps: | ||
# step 1: checkout repository code inside the workspace directory of the runner | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
# attach GCC problem matcher - will pin problems to files only in current submodule | ||
- name: Add GCC problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
# 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 }} | ||
# 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@v4 | ||
with: | ||
name: phoenix-rtos-${{ matrix.target }} | ||
path: | | ||
_boot/${{ matrix.target }} | ||
rootfs-${{ matrix.target }}.tar | ||
test-hw: | ||
needs: build | ||
name: test HW | ||
runs-on: ${{ matrix.target }} | ||
outputs: | ||
runner_result: ${{ steps.runner.outcome }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: ['armv7a9-zynq7000-zedboard'] | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: phoenix-rtos-${{ matrix.target }} | ||
- name: Untar rootfs | ||
working-directory: _fs | ||
run: tar -xvf ../rootfs-${{ matrix.target }}.tar | ||
- name: Test runner | ||
id: runner | ||
run: | | ||
python3 ./phoenix-rtos-tests/runner.py -v -T${{ matrix.target }} ${{ inputs.nightly && '--nightly' || '' }} -Oresults.csv | ||
- name: Upload runner results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results-${{ matrix.target }} | ||
path: | | ||
results.csv | ||
results.xml | ||
tests-summary: | ||
if: success() || failure() # don't care about cancelled runs | ||
needs: ['test-hw'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
pattern: test-results-* | ||
- 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@v4 | ||
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-hw'] | ||
if: failure() && github.event_name != 'pull_request' | ||
uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/_send_google_chat.yml@master | ||
secrets: inherit |