Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Commit

Permalink
Fix CI settings (#23)
Browse files Browse the repository at this point in the history
* Fix long name

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Remvoe probably unnecessary comments

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Revive fail_ci_if_error of Codecov

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Add workflow_dispatch to all workflows

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Use ubuntu-latest

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Add container

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Replace unnecessary id `plum` to `set_env`

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Unify github action's version

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Define GITHUB_PAGES_URL

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix name

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Delete unnecessary workflow_dispatch

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix lizard command

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Change file name

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Update .github/workflows/code_metrics_pr.yml

Co-authored-by: Keisuke Shima <keisuke.shima@tier4.jp>

* Update .github/workflows/code_metrics_main.yml

Co-authored-by: Keisuke Shima <keisuke.shima@tier4.jp>

* Update .github/workflows/build_and_test.yml

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>

* Update .github/workflows/nightly_clang_build.yml

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>

* Update .github/workflows/nightly_clang_build.yml

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>

* Fixup

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

Co-authored-by: Keisuke Shima <keisuke.shima@tier4.jp>
Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>
  • Loading branch information
3 people authored Mar 30, 2021
1 parent aaa2a32 commit 8e09f12
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 39 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Build and test (actions-ros + setup-ros on ubuntu:focal)
name: Build and test

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
container: ubuntu:focal

steps:
- name: Check out repo
uses: actions/checkout@v2
with:
fetch-depth: 2 # https://github.com/codecov/codecov-action/issues/190#issuecomment-790729633
fetch-depth: 2 # https://github.com/codecov/codecov-action/issues/190#issuecomment-790729633

- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.1
Expand All @@ -24,27 +24,33 @@ jobs:

- name: Run action-ros-ci
id: action_ros_ci_step
uses: ros-tooling/action-ros-ci@v0.1
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: obstacle_stop_planner_refine
target-ros2-distro: foxy
vcs-repo-file-url: build_depends.repos
colcon-mixin-name: coverage-gcc coverage-pytest
# If possible, pin the repository in the workflow to a specific commit to avoid
# changes in colcon-mixin-repository from breaking your tests.
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc", "coverage-pytest"]
},
"test": {
"mixin": ["coverage-pytest"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/1ddb69bedfd1f04c2f000e95452f7c24a4d6176b/index.yaml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.2.1
uses: codecov/codecov-action@v1
with:
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage
flags: unittests
name: codecov-umbrella
# fail_ci_if_error: true # Temporarily disable it to suppress errors when there is no unit test.
fail_ci_if_error: true
verbose: true

- name: Upload colcon-logs
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: colcon-logs
path: ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/log
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/code_metrics_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ on:
push:
branches:
- main
workflow_dispatch:

env:
GITHUB_PAGES_URL: https://tier4.github.io/obstacle_stop_planner_refine

jobs:
code-metrics:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2
Expand All @@ -16,10 +21,10 @@ jobs:
run: |
git clone https://github.com/terryyin/lizard.git
mkdir -p public/pr-check/main
python3 lizard/lizard.py obstacle_stop_planner_refine/ -l cpp -l python -x"*test*" \
python3 lizard/lizard.py -l cpp -l python -x "*test*" \
--CCN 20 -T nloc=200 --arguments 6 \
--html > public/pr-check/main/code-metrics.html || true
python3 lizard/lizard.py obstacle_stop_planner_refine/ -l cpp -l python -x"*test*" \
python3 lizard/lizard.py -l cpp -l python -x "*test*" \
--CCN 20 -T nloc=200 --arguments 6 || true
- name: Deploy measurement result page to gh-pages
Expand All @@ -32,6 +37,7 @@ jobs:
create-index-page:
needs: code-metrics
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2
Expand All @@ -41,7 +47,7 @@ jobs:
- name: Create index page
run: |
cd pr-check
tree -H 'https://tier4.github.io/obstacle_stop_planner_refine/pr-check' \
tree -H "$GITHUB_PAGES_URL/pr-check" \
-L 2 --noreport --charset utf-8 -T 'Index of code metrics' \
-P "*.html" > index.html
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/code_metrics_pr.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: Measure code metrics
name: Measure code metrics for PR

on:
pull_request:
workflow_dispatch:

env:
GITHUB_PAGES_URL: https://tier4.github.io/obstacle_stop_planner_refine

jobs:
code-metrics:
runs-on: ubuntu-latest

steps:
- name: Set environment variable
id: plum
id: set_env
run: echo "::set-output name=PULL_NUMBER::$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)"

- name: Check out repo
Expand All @@ -23,17 +26,17 @@ jobs:
mkdir -p public/pr-check
git diff origin/$GITHUB_HEAD_REF..origin/$GITHUB_BASE_REF \
--diff-filter=AM \
--name-only -- '*.hpp' '*.cpp' '*.py' > file_list.txt
python3 lizard/lizard.py obstacle_stop_planner_refine/ -l cpp -l python -x"*test*" -f file_list.txt \
--name-only -- '*.hpp' '*.cpp' '*.py' > changed_file_list.txt
python3 lizard/lizard.py -l cpp -l python -x "*test*" -f changed_file_list.txt \
--CCN 20 -T nloc=200 --arguments 6 \
--html > public/pr-check/code-metrics.html || true
python3 lizard/lizard.py obstacle_stop_planner_refine/ -l cpp -l python -x"*test*" -f file_list.txt \
python3 lizard/lizard.py -l cpp -l python -x "*test*" -f changed_file_list.txt \
--CCN 20 -T nloc=200 --arguments 6 || true
- name: Rename file
run: |
mkdir public/pr-check/pr${{ steps.plum.outputs.PULL_NUMBER }}
mv public/pr-check/code-metrics.html public/pr-check/pr${{ steps.plum.outputs.PULL_NUMBER }}/code-metrics.html
mkdir public/pr-check/pr${{ steps.set_env.outputs.PULL_NUMBER }}
mv public/pr-check/code-metrics.html public/pr-check/pr${{ steps.set_env.outputs.PULL_NUMBER }}/code-metrics.html
- name: Deploy measurement result page to gh-pages
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -50,13 +53,14 @@ jobs:
### :bar_chart: Code Metrics Report
Branch | Metrics
------- | -------
This PR | [code-metrics.html](https://tier4.github.io/obstacle_stop_planner_refine/pr-check/pr${{ steps.plum.outputs.PULL_NUMBER }}/code-metrics.html)
main | [code-metrics.html](https://tier4.github.io/obstacle_stop_planner_refine/pr-check/main/code-metrics.html)
This PR | [code-metrics.html]($GITHUB_PAGES_URL/pr-check/pr${{ steps.set_env.outputs.PULL_NUMBER }}/code-metrics.html)
main | [code-metrics.html]($GITHUB_PAGES_URL/pr-check/main/code-metrics.html)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create-index-page:
needs: code-metrics
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2
Expand All @@ -66,7 +70,7 @@ jobs:
- name: Create index page
run: |
cd pr-check
tree -H 'https://tier4.github.io/obstacle_stop_planner_refine/pr-check' \
tree -H "$GITHUB_PAGES_URL/pr-check" \
-L 2 --noreport --charset utf-8 -T 'Index of code metrics' \
-P "*.html" > index.html
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Set environment variable
id: plum
id: set_env
run: echo "::set-output name=PULL_NUMBER::$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)"

- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: "3.8"

- name: Build MkDocs
run: |
Expand All @@ -31,8 +33,8 @@ jobs:
- name: Change directory structure
run: |
mkdir -p public/pr-check/pr${{ steps.plum.outputs.PULL_NUMBER }}
mv site public/pr-check/pr${{ steps.plum.outputs.PULL_NUMBER }}/
mkdir -p public/pr-check/pr${{ steps.set_env.outputs.PULL_NUMBER }}
mv site public/pr-check/pr${{ steps.set_env.outputs.PULL_NUMBER }}/
- name: Deploy MkDocs to gh-pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/nightly_clang_build.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
name: Clang nightly build

on:
workflow_dispatch:
schedule:
- cron: "0 19 * * *" # run at 4 AM JST
workflow_dispatch:

jobs:
build-using-clang:
runs-on: ubuntu-20.04
container: ubuntu:focal
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2

- name: Setup ROS environment
uses: ros-tooling/setup-ros@0.1.1
uses: ros-tooling/setup-ros@v0.1
with:
required-ros-distributions: foxy

- name: Run action-ros-ci
id: action_ros_ci_step
uses: ros-tooling/action-ros-ci@0.1.2
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: obstacle_stop_planner_refine
target-ros2-distro: foxy
vcs-repo-file-url: build_depends.repos
colcon-mixin-name: clang-libcxx
# If possible, pin the repository in the workflow to a specific commit to avoid
# changes in colcon-mixin-repository from breaking your tests.
colcon-defaults: |
{
"build": {
"mixin": ["release", "compile-commands"],
"cmake-args": [
"-DCMAKE_C_COMPILER=clang",
"-DCMAKE_CXX_COMPILER=clang++",
"-DCMAKE_CXX_FLAGS='-Wthread-safety'",
"-DFORCE_BUILD_VENDOR_PKG=ON"
],
"continue-on-error": true
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/1ddb69bedfd1f04c2f000e95452f7c24a4d6176b/index.yaml
extra-cmake-args: -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

0 comments on commit 8e09f12

Please sign in to comment.