Skip to content

Commit

Permalink
ci: simplify workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
  • Loading branch information
Kenji Miyake committed Nov 30, 2022
1 parent f1a593f commit d6077a7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 154 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/build-humble-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,14 @@ on:
jobs:
build-humble-self-hosted:
runs-on: [self-hosted, linux, ARM64]
container: ubuntu:22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Trigger workflow
uses: actions/github-script@v6
with:
ref: humble

- name: Run setup script
run: |
./setup-dev-env.sh -y universe
- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
- name: Run vcs export
run: |
vcs export --exact src || true
- name: Run rosdep install
run: |
sudo apt-get -y update
rosdep update
DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble
- name: Build
run: |
. /opt/ros/humble/setup.sh
colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-main.yaml',
ref: 'humble',
})
42 changes: 9 additions & 33 deletions .github/workflows/build-humble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,14 @@ on:
jobs:
build-humble:
runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Trigger workflow
uses: actions/github-script@v6
with:
ref: humble

- name: Run setup script
run: |
./setup-dev-env.sh -y
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
- name: Run vcs export
run: |
vcs export --exact src || true
- name: Run rosdep install
run: |
sudo apt-get -y update
rosdep update
DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble
- name: Build
run: |
. /opt/ros/humble/setup.sh
colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-main.yaml',
ref: 'humble',
})
58 changes: 9 additions & 49 deletions .github/workflows/docker-build-and-push-humble-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,14 @@ on:
jobs:
docker-build-and-push-humble-self-hosted:
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
name:
- no-cuda
- cuda
include:
- name: no-cuda
base_image_env: base_image
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
base_image_env: cuda_base_image
setup-args: --no-cuda-drivers
additional-tag-suffix: -cuda
steps:
# https://github.com/actions/checkout/issues/211
- name: Change permission of workspace
run: |
sudo chown -R $USER:$USER ${{ github.workspace }}
- name: Check out repository
uses: actions/checkout@v3
with:
ref: humble

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Load env
run: |
cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV
if [ "$(uname -m)" = "aarch64" ]; then
cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV
fi
- name: Build 'autoware-universe'
uses: ./.github/actions/docker-build-and-push
- name: Trigger workflow
uses: actions/github-script@v6
with:
bake-target: autoware-universe
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
tag-prefix: ${{ env.rosdistro }}-
tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64

- name: Show disk space
run: |
df -h
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'docker-build-and-push-main-self-hosted.yaml',
ref: 'humble',
})
53 changes: 9 additions & 44 deletions .github/workflows/docker-build-and-push-humble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,14 @@ on:
jobs:
docker-build-and-push-humble:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- no-cuda
- cuda
include:
- name: no-cuda
base_image_env: base_image
setup-args: --no-nvidia
additional-tag-suffix: ""
- name: cuda
base_image_env: cuda_base_image
setup-args: --no-cuda-drivers
additional-tag-suffix: -cuda
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Trigger workflow
uses: actions/github-script@v6
with:
ref: humble

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Load env
run: |
cat amd64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV
if [ "$(uname -m)" = "aarch64" ]; then
cat arm64.env | sed -e "s/^\s*//" -e "/^#/d" >> $GITHUB_ENV
fi
- name: Build 'autoware-universe'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-universe
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
tag-prefix: ${{ env.rosdistro }}-
tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64

- name: Show disk space
run: |
df -h
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'docker-build-and-push-main.yaml',
ref: 'humble',
})

0 comments on commit d6077a7

Please sign in to comment.