Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/phoenix-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inputs:
# action runner
runs:
using: 'docker'
image: 'phoenixrtos/build'
image: 'potrzebne/build'
env:
CONSOLE: 'serial'
TARGET: ${{ inputs.target }}
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/phoenix-clang-tidy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# vim:sw=2:ts=2
# action name
name: 'phoenix-clang-tidy'

# action description
description: 'Runs clang-tidy'

inputs:
files:
description: 'Specifies files to run clang-tidy'
required: false


# action clang-tidy
runs:
using: 'docker'
image: 'potrzebne/devel'
entrypoint: ./scripts/ci/phoenix_clang_tidy.py
args:
- ${{ inputs.files }}

# branding
branding:
icon: terminal
color: green
194 changes: 138 additions & 56 deletions .github/workflows/ci-submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
build_params:
type: string
description: "parameters to build.sh script"
default: 'core fs test project image' # by default don't build ports
default: 'bear core fs test project image' # by default don't build ports
required: false


Expand All @@ -29,14 +29,15 @@ jobs:
include:
- target: 'ia32-generic-qemu'
syspage: 'psh pc-ata uart16550'
- target: 'armv7a9-zynq7000-qemu'
additional_params: 'ports'
#- target: 'armv7a9-zynq7000-qemu'
# additional_params: 'ports'
steps:
# step 1: checkout phoenix-rtos-project repository code inside the workspace directory of the runner
- name: Checkout phoenix-rtos-project
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phoenix-rtos/phoenix-rtos-project
repository: jsarzy/phoenix-rtos-project
ref: clang
submodules: recursive

# step 2: update the submodule (recurse-sumbodules=no is needed for phoenix-rtos-lwip checkout not to fail, but it fails to update the submodule (TODO)
Expand Down Expand Up @@ -73,23 +74,29 @@ jobs:
_boot/${{ matrix.target }}
rootfs-${{ matrix.target }}.tar

test-emu:
- name: Upload clang-tidy artifacts
uses: actions/upload-artifact@v2
with:
name: clang-tidy-artifacts
path: |
_build/*/include
_build/*/compile_commands.json

clang-tidy:
if: github.event_name == 'pull_request'
needs: build
name: run tests on emulators
name: run clang-tidy
runs-on: ubuntu-latest
outputs:
runner_result: ${{ steps.runner.outcome }}
strategy:
matrix:
target: ['armv7a9-zynq7000-qemu', 'host-generic-pc', 'ia32-generic-qemu']

steps:
- name: Checkout phoenix-rtos-project
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phoenix-rtos/phoenix-rtos-project
repository: jsarzy/phoenix-rtos-project
ref: clang
submodules: recursive

# step 2: update the submodule (recurse-sumbodules=no is needed for phoenix-rtos-lwip checkout not to fail, but it fails to update the submodule (TODO)
- name: Update submodule ${{ github.event.repository.name }}
working-directory: ${{ github.event.repository.name }}
run: |
Expand All @@ -100,34 +107,69 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: phoenix-rtos-${{ matrix.target }}
name: clang-tidy-artifacts
path: _build

- name: Untar rootfs
working-directory: _fs
run: tar -xvf ../rootfs-${{ matrix.target }}.tar
- name: Filter compile_commands.json
run: |
for file in _build/*/compile_commands.json; do
sed -i "s/-msingle-pic-base//g" $file
sed -i "s/-mno-pic-data-is-text-relative//g" $file
sed -i "s/-fstack-usage//g" $file
done

- name: Test runner
id: runner
uses: ./.github/actions/phoenix-runner
- name: Get changed and added files
id: changed_files
run: scripts/ci/changed_files.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.repository.name }}

- name: Echo added files
run: |
echo ${{ steps.changed_files.outputs.files }}
pwd


- name: Run phoenix_clang_tidy
# if: changed files are not empty
uses: ./.github/actions/phoenix-clang-tidy
with:
target: ${{ matrix.target }}
files: ${{ steps.changed_files.outputs.files }}

# runs on self-hosted runners with HW targets attached
test-hw:
- name: Upload clang-tidy results
uses: actions/upload-artifact@v2
with:
name: clang-tidy-result
path: result.json

- name: Install reviewdog
run: |
wget http://misc.nalajcie.org/reviewdog -O /tmp/reviewdog 2>/dev/null
chmod +x /tmp/reviewdog

- name: Reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ github.event.repository.name }}
git diff -U0 HEAD^
cat ../result.json | /tmp/reviewdog -f=rdjson -diff="git diff -U0 HEAD^" -name=clang-tidy -reporter=github-pr-review -fail-on-error


test-emu:
needs: build
name: run tests on hardware
runs-on: ${{ matrix.target }}
name: run tests on emulators
runs-on: ubuntu-latest
outputs:
runner_result: ${{ steps.runner.outcome }}
strategy:
matrix:
target: ['armv7m7-imxrt106x-evk', 'armv7m7-imxrt117x-evk']
target: ['armv7a9-zynq7000-qemu', 'host-generic-pc', 'ia32-generic-qemu']

steps:
- name: Checkout phoenix-rtos-project
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phoenix-rtos/phoenix-rtos-project
repository: jsarzy/phoenix-rtos-project
ref: clang
submodules: recursive

- name: Update submodule ${{ github.event.repository.name }}
Expand All @@ -148,32 +190,72 @@ jobs:

- name: Test runner
id: runner
run: |
python3 ./phoenix-rtos-tests/runner.py -T${{ matrix.target }}

mail-notification:
if: ${{ failure() }}
needs: ['build', 'test-emu', 'test-hw']
name: notify ci team using e-mail
runs-on: ubuntu-latest
steps:
- name: Send mail
# If there is some failure, not caused by build step or test runner step send mail
if: >-
${{ needs.build.outputs.build_result != 'failure'
&& needs.test-emu.outputs.runner_result != 'failure'
&& needs.test-hw.outputs.runner_result != 'failure' }}
uses: dawidd6/action-send-mail@v3
uses: ./.github/actions/phoenix-runner
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.CI_BOT_EMAIL_USERNAME }}
password: ${{ secrets.CI_BOT_EMAIL_PASSWORD }}
subject: Github Actions Warning
to: [email protected]
# Required sender full name (address can be skipped):
from: Continuous Integration Bot
# Optional whether this connection use TLS (default is true if server_port is 465)
secure: true
body: There is some problem with GH Actions. https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
target: ${{ matrix.target }}

# runs on self-hosted runners with HW targets attached
# test-hw:
# needs: build
# name: run tests on hardware
# runs-on: ${{ matrix.target }}
# outputs:
# runner_result: ${{ steps.runner.outcome }}
# strategy:
# matrix:
# target: ['armv7m7-imxrt106x-evk', 'armv7m7-imxrt117x-evk']
#
# steps:
# - name: Checkout phoenix-rtos-project
# uses: actions/checkout@v2
# with:
# repository: phoenix-rtos/phoenix-rtos-project
# submodules: recursive
#
# - name: Update submodule ${{ github.event.repository.name }}
# working-directory: ${{ github.event.repository.name }}
# run: |
# git fetch --recurse-submodules=no --force ${{ github.event.repository.clone_url }} "+refs/heads/*:refs/remotes/origin/*"
# git fetch --recurse-submodules=no --force ${{ github.event.repository.clone_url }} "+refs/pull/*/head:refs/remotes/origin/pr/*"
# git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }}
#
# - name: Download build artifacts
# uses: actions/download-artifact@v2
# 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 -T${{ matrix.target }}
#
# mail-notification:
# if: ${{ failure() }}
# needs: ['build', 'test-emu', 'test-hw']
# name: notify ci team using e-mail
# runs-on: ubuntu-latest
# steps:
# - name: Send mail
# # If there is some failure, not caused by build step or test runner step send mail
# if: >-
# ${{ needs.build.outputs.build_result != 'failure'
# && needs.test-emu.outputs.runner_result != 'failure'
# && needs.test-hw.outputs.runner_result != 'failure' }}
# uses: dawidd6/action-send-mail@v3
# with:
# server_address: smtp.gmail.com
# server_port: 465
# username: ${{ secrets.CI_BOT_EMAIL_USERNAME }}
# password: ${{ secrets.CI_BOT_EMAIL_PASSWORD }}
# subject: Github Actions Warning
# to: [email protected]
# # Required sender full name (address can be skipped):
# from: Continuous Integration Bot
# # Optional whether this connection use TLS (default is true if server_port is 465)
# secure: true
# body: There is some problem with GH Actions. https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
#
Loading