Skip to content

Commit

Permalink
Revert "Update and refactor workflows"
Browse files Browse the repository at this point in the history
  • Loading branch information
hakuturu583 authored Mar 1, 2024
1 parent df55bec commit 240d865
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 69 deletions.
54 changes: 30 additions & 24 deletions .github/workflows/BuildAndRun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
- cron: 0 0 * * *
pull_request:
paths:
- "**"
- "!docs/**"
- "!README.md"
- "!.github/**"
- ".github/workflows/BuildAndRun.yaml"
- "!mkdocs.yml"
- "!pyproject.toml"
- "!poetry.lock"
- '**'
- '!docs/**'
- '!README.md'
- '!.github/**'
- '.github/workflows/BuildAndRun.yaml'
- '!mkdocs.yml'
- '!pyproject.toml'
- '!poetry.lock'
push:
branches:
- master
Expand All @@ -31,20 +31,15 @@ jobs:
rosdistro: [humble]
steps:
- name: Suppress warnings
run: git config --global --add safe.directory '*'

- name: Setup workspace
run: mkdir -p src/scenario_simulator_v2
run: |
git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v2-beta
with:
fetch-depth: 0
path: src/scenario_simulator_v2
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
with:
repository: RobotecAI/scenario_simulator_v2_scenarios
path: src/scenario_simulator_v2_scenarios
- run: git clone https://github.com/RobotecAI/scenario_simulator_v2_scenarios.git

- name: Search packages in this repository
id: list_packages
Expand All @@ -55,27 +50,37 @@ jobs:
run: |
echo "Target packages: ${{ steps.list_packages.outputs.package_list }}"
- name: Copy repository
run: |
mkdir -p ~/ros2_ws/src/scenario_simulator_v2
cp -rf . ~/ros2_ws/src/scenario_simulator_v2
shell: bash

- name: Install dependencies
run: |
cd ~/ros2_ws
vcs import src < src/scenario_simulator_v2/dependency_${{ matrix.rosdistro }}.repos
- name: Resolve rosdep
run: |
apt-get update
apt-get install -y python3-pip
cd ~/ros2_ws
apt update
apt install -y python3-pip
rosdep update --include-eol-distros
rosdep install -iy --from-paths src --rosdistro ${{ matrix.rosdistro }}
shell: bash

- name: Build packages
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
cd ~/ros2_ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_CPP_MOCK_SCENARIOS=ON --packages-up-to ${{ steps.list_packages.outputs.package_list }}
shell: bash

- name: Colcon test
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
cd ~/ros2_ws
source install/local_setup.bash
colcon test --packages-select ${{ steps.list_packages.outputs.package_list }}
shell: bash
Expand All @@ -84,22 +89,23 @@ jobs:
if: always()
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
cd ~/ros2_ws
source install/local_setup.bash
colcon test-result --verbose
shell: bash

- name: Scenario test
run: |
source install/setup.bash
source install/local_setup.bash
source ~/ros2_ws/install/setup.bash
source ~/ros2_ws/install/local_setup.bash
ros2 launch scenario_test_runner scenario_test_runner.launch.py workflow:='$(find-pkg-share scenario_test_runner)/config/workflow_example.yaml' global_frame_rate:=20
ros2 run scenario_test_runner result_checker.py /tmp/scenario_test_runner/result.junit.xml
shell: bash

- name: Basic test
run: |
source install/setup.bash
source install/local_setup.bash
source ~/ros2_ws/install/setup.bash
source ~/ros2_ws/install/local_setup.bash
ros2 launch scenario_test_runner scenario_test_runner.launch.py workflow:='$(find-pkg-share scenario_simulator_v2_scenarios)/workflow/basic.yaml'
ros2 run scenario_test_runner result_checker.py /tmp/scenario_test_runner/result.junit.xml
shell: bash
3 changes: 1 addition & 2 deletions .github/workflows/CheckBranchUpToDate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-tags: true

- name: Check if branches are up to date
shell: bash
run: |
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/Documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,28 @@ jobs:
name: Generate documentation
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v2-beta
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

uses: docker/setup-buildx-action@v2
- name: run protoc-gen-doc
run: docker run --rm -v $(pwd)/simulation/simulation_interface/proto/:/protos -v $(pwd)/docs/proto_doc:/out pseudomuto/protoc-gen-doc --doc_opt=markdown,protobuf.md

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.5.1"

- name: install
run: poetry install --no-interaction

- name: Generate documentation
run: poetry run mkdocs build

- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: site
path: site
retention-days: 1

- name: Publish Documentation
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -54,26 +46,21 @@ jobs:
publish_dir: site
keep_files: false
external_repository: tier4/scenario_simulator_v2-docs

generate_api_document:
generate_api_document:
name: Generate API documentation
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v2-beta
- name: Install doxygen
run: sudo apt-get install -y doxygen

run: sudo apt install -y doxygen
- name: Build document
run: doxygen Doxyfile

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: api_documentation_site
path: html
retention-days: 1

- name: Publish Documentation
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}}
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/DocumentationLinkCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Check documentation link
id: lychee
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/InterfaceUpdateNotification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add label
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/LineLint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Line lint
on:
on:
workflow_dispatch:
push:

Expand All @@ -8,5 +8,5 @@ jobs:
runs-on: ubuntu-latest
name: Check if all files end in newline
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- uses: fernandrone/[email protected]
19 changes: 2 additions & 17 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- master
types:
- closed
- created
- edited
- labeled
- opened
Expand Down Expand Up @@ -33,81 +34,68 @@ jobs:
steps:
- name: Restore branch
uses: levonet/action-restore-branch@master

- name: Install bloom
run: apt update && apt install -y python3-bloom git

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
fetch-tags: true

- name: Setup git
run: |
git config --global user.name "Release Bot"
git config --global user.email "[email protected]"
git config --global --add safe.directory /__w/scenario_simulator_v2/scenario_simulator_v2
git config --global credential.helper ${{ secrets.GITHUB_TOKEN }}
git config pull.rebase false
- name: Get old version
id: old_version
run: |
echo "old_version=$(catkin_package_version)" >> $GITHUB_OUTPUT
- name: Merge branch
run: git pull origin ${{ github.head_ref }}

- name: Bump patch version
if: (contains(github.event.pull_request.labels.*.name, 'bump patch'))
run: |
catkin_generate_changelog -y
catkin_tag_changelog --bump patch
catkin_package_version --bump patch
- name: Bump minor version
if: (contains(github.event.pull_request.labels.*.name, 'bump minor'))
run: |
catkin_generate_changelog -y
catkin_tag_changelog --bump minor
catkin_package_version --bump minor
- name: Bump major version
if: (contains(github.event.pull_request.labels.*.name, 'bump major'))
run: |
catkin_generate_changelog -y
catkin_tag_changelog --bump major
catkin_package_version --bump major
- name: Get new version
id: new_version
run: |
echo "new_version=$(catkin_package_version)" >> $GITHUB_OUTPUT
- name: Commit changes
if: github.event.pull_request.merged == true
run: |
git add .
git commit -m "Bump version of scenario_simulator_v2 from version ${{ steps.old_version.outputs.old_version }} to version ${{ steps.new_version.outputs.new_version }}"
- name: Pushing to the protected branch 'master'
if: github.event.pull_request.merged == true
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.BLOOM_GITHUB_TOKEN }}
branch: master
force: true

- name: Get linked issues
id: linked_issues
uses: hossainemruz/linked-issues@main
with:
pr_url: ${{github.event.pull_request.html_url}}
format: ExternalIssueRef
continue-on-error: true

- name: Update release description
env:
PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
Expand All @@ -116,21 +104,18 @@ jobs:
echo "" >> release_description.txt
echo "# Related Issues " >> release_description.txt
echo "${{ steps.linked_issues.outputs.issues }}" >> release_description.txt
- name: Get release description
id: get_release_description
uses: mathiasvr/[email protected]
with:
run: cat release_description.txt

- name: Create a GitHub release
if: github.event.pull_request.merged == true
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.new_version.outputs.new_version }}
name: ${{ steps.new_version.outputs.new_version }}
body: ${{ steps.get_release_description.outputs.stdout }}

- name: Delete branch
if: github.event.pull_request.merged == true
uses: SvanBoxel/delete-merged-branch@main
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/SimModelUpdateNotification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add comment
run: |
gh pr comment "$PR_NUMBER" --edit-last --body "This PR edits vehicle model that is copied from [simple_planning_simulator](https://github.com/autowarefoundation/autoware.universe/tree/main/simulator/simple_planning_simulator). Please consider making changes to the original code to avoid confusion or consult developers (@hakuturu583, @yamacir-kit and @HansRobo )." \
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/SpellCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Run spell-check
uses: autowarefoundation/autoware-github-actions/spell-check@v1
Expand All @@ -20,3 +20,4 @@ jobs:
local-cspell-json: .github/workflows/custom_spell.json
dict-packages: |
https://github.com/tier4/cspell-dicts
verbose: true
3 changes: 2 additions & 1 deletion .github/workflows/SpellCheckAll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Run spell-check
uses: autowarefoundation/autoware-github-actions/spell-check@v1
Expand All @@ -21,3 +21,4 @@ jobs:
dict-packages: |
https://github.com/tier4/cspell-dicts
incremental-files-only: false
verbose: true

0 comments on commit 240d865

Please sign in to comment.