Skip to content

Commit

Permalink
ci: add lint & simple build
Browse files Browse the repository at this point in the history
JIRA: CI-334
  • Loading branch information
nalajcie committed Sep 4, 2023
1 parent b9d1669 commit 5ca1c9c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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}}
17 changes: 17 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5ca1c9c

Please sign in to comment.