-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (78 loc) · 2.68 KB
/
codacy-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Codacy Analysis
on:
pull_request:
jobs:
codacy-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup ROS 2 Sources List
run: |
sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
- name: Install rosdep
run: |
sudo apt-get install -y python3-rosdep
sudo rosdep init
rosdep update
- name: Install ROS 2 dependencies
run: |
rosdep install --from-paths . --ignore-src -r -y
- name: Install rclpy
run: |
python -m pip install rclpy
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests and coverage
run: |
coverage run -m pytest
coverage xml -o coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Upload coverage to Codacy
run: python-codacy-coverage -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# name: Codacy Analysis
# on:
# pull_request:
# jobs:
# codacy-analysis:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Setup ROS 2 Sources List
# run: |
# sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list'
# sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# sudo apt-get update
# - name: Install rosdep
# run: |
# sudo apt-get install -y python3-rosdep
# sudo rosdep init
# rosdep update
# - name: Install ROS 2 dependencies
# run: |
# rosdep install --from-paths src --ignore-src -r -y
# - name: Install rclpy
# run: |
# python -m pip install rclpy
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# - name: Run tests and coverage
# run: |
# coverage run -m pytest
# coverage xml -o coverage.xml
# env:
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# - name: Upload coverage to Codacy
# run: python-codacy-coverage -r coverage.xml
# env:
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}