Skip to content

Commit

Permalink
reuse load-env.yaml to load env
Browse files Browse the repository at this point in the history
  • Loading branch information
youtalk committed May 17, 2024
1 parent 470a8b5 commit fa07a0a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 36 deletions.
15 changes: 6 additions & 9 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.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ env[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
15 changes: 6 additions & 9 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.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ env[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
15 changes: 6 additions & 9 deletions .github/workflows/docker-build-and-push-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ on:
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 @@ 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-openadk'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
build-args: |
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ env[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
15 changes: 6 additions & 9 deletions .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ on:
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 @@ 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-openadk'
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware-openadk
build-args: |
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ env.rosdistro }}
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ env[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

0 comments on commit fa07a0a

Please sign in to comment.