From 5ca1c9ccfcfb08a1de545c7a0a2bb1a8c4290d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Bia=C5=82ow=C4=85s?= Date: Mon, 4 Sep 2023 17:09:46 +0200 Subject: [PATCH] ci: add lint & simple build JIRA: CI-334 --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 17 ++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b860c8b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +# vim:sw=2:ts=2 +# copy of ci-submodule.yml - but building only host tools on host-generic-pc TARGET +name: ci + +# on events +on: + push: + branches: + - master + - 'feature/*' + pull_request: + branches: + - master + - 'feature/*' + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + # step 1 : checkout submodule + - name: Checkout submodule + uses: actions/checkout@v3 + with: + submodules: recursive + + # step 2: checkout phoenix-rtos-project repository code in .buildroot and symlink submodule name to `workspace` + # that way workspace file paths will match submodule paths - making problem matchers work + # BUILD_DIRECTORY - absolute path to phoenix-rtos-project + # CI_CUSTOM_BUILDROOT - relative path to phoenix-rtos-project (from GH Actions workspace) + - name: Checkout phoenix-rtos-project + # we need to use relative paths here so they would work in docker env + run: | + mkdir .buildroot && cd .buildroot + git clone https://github.com/phoenix-rtos/phoenix-rtos-project --recurse-submodules + cd phoenix-rtos-project + echo "BUILD_DIRECTORY=$(pwd)" >> $GITHUB_ENV + echo "CI_CUSTOM_BUILDROOT=.buildroot/phoenix-rtos-project" >> $GITHUB_ENV + git log -1 --pretty=oneline + git submodule + rm -rf ${{ github.event.repository.name }} + ln -s ../.. ${{ github.event.repository.name }} + + # attach GCC problem matcher - will pin problems to files only in current submodule + - uses: ammaraskar/gcc-problem-matcher@master + + # step 3: use our custom action to build the project + - name: Build + id: build + uses: ./.buildroot/phoenix-rtos-project/.github/actions/phoenix-build # BUILD_DIRECTORY value, but we can't use templates here + with: + target: 'host-generic-pc' + params: host + buildroot: ${{env.CI_CUSTOM_BUILDROOT}} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4da9c56 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +# vim:sw=2:ts=2 +name: lint + +# on events +on: + push: + branches: + - master + - 'feature/*' + pull_request: + branches: + - master + - 'feature/*' + +jobs: + call-lint: + uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/lint.yml@master