Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ci): reuse load-env.yaml to load env #4734

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/build-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ on:
default: tarball

jobs:
load-env:
uses: ./.github/workflows/load-env.yaml

build-main-self-hosted:
needs: load-env
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
Expand Down Expand Up @@ -43,25 +47,18 @@ jobs:
- 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-openadk
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64
tag-prefix: ${{ env.rosdistro }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: false

- name: Show disk space
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/build-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ on:
default: tarball

jobs:
load-env:
uses: ./.github/workflows/load-env.yaml

build-main:
needs: load-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -38,25 +42,18 @@ jobs:
- 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-openadk
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64
tag-prefix: ${{ env.rosdistro }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: false

- name: Show disk space
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/docker-build-and-push-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
on:
push:
tags:
- adkit-v*.*.*

Check warning on line 12 in .github/workflows/docker-build-and-push-main-self-hosted.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (adkit)
branches:
- main
schedule:
Expand All @@ -25,7 +25,11 @@
default: tarball

jobs:
load-env:
uses: ./.github/workflows/load-env.yaml

docker-build-and-push-main-self-hosted:
needs: load-env
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
Expand Down Expand Up @@ -55,25 +59,18 @@
- 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-openadk'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64
tag-prefix: ${{ env.rosdistro }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true

- name: Show disk space
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
on:
push:
tags:
- adkit-v*.*.*

Check warning on line 12 in .github/workflows/docker-build-and-push-main.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (adkit)
branches:
- main
schedule:
Expand All @@ -25,7 +25,11 @@
default: tarball

jobs:
load-env:
uses: ./.github/workflows/load-env.yaml

docker-build-and-push-main:
needs: load-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -50,25 +54,18 @@
- 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-openadk'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.BASE_IMAGE=${{ env[format('{0}', matrix.base_image_env)] }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs[format('{0}', matrix.base_image_env)] }}
*.args.SETUP_ARGS=${{ matrix.setup-args }}
*.args.LIB_DIR=${{ matrix.lib_dir }}
tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64
tag-prefix: ${{ env.rosdistro }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true

- name: Show disk space
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/load-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: load-env
on:
workflow_call:
outputs:
base-image:
value: ${{ jobs.load-env.outputs.base-image }}
base_image:
value: ${{ jobs.load-env.outputs.base_image }}
rosdistro:
value: ${{ jobs.load-env.outputs.rosdistro }}

jobs:
load-env:
runs-on: ubuntu-latest
outputs:
base-image: ${{ steps.set-env.outputs.base-image }}
base_image: ${{ steps.set-env.outputs.base_image }}
rosdistro: ${{ steps.set-env.outputs.rosdistro }}
steps:
- name: Check out repository
Expand All @@ -28,5 +28,5 @@ jobs:
- name: Set env
id: set-env
run: |
echo "base-image=${{ env.base_image }}" >> $GITHUB_OUTPUT
echo "base_image=${{ env.base_image }}" >> $GITHUB_OUTPUT
echo "rosdistro=${{ env.rosdistro }}" >> $GITHUB_OUTPUT
Loading