Skip to content

Commit

Permalink
Merge pull request #81 from youtalk/upstream-to-main
Browse files Browse the repository at this point in the history
feat: upstream to main
  • Loading branch information
youtalk authored Jul 19, 2024
2 parents f285113 + 43676f5 commit b8e7586
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 55 deletions.
23 changes: 16 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
*.md

# Ignore Docker files
docker-bake.hcl
docker
!docker/etc

# Etc
*.ignore
*.lint
*.lock
*.log
*.out
# Ignore a part of files under src
src/**/.*
src/**/*.asc
src/**/*.csv
src/**/*.gif
src/**/*.md
src/**/*.pcd
src/**/*.png
src/**/*.svg

# Ignore generated files by colcon
build
install
log
27 changes: 2 additions & 25 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ inputs:
tag-suffix:
description: ""
required: false
allow-push:
description: ""
default: "true"
required: false
dockerhub-token:
description: ""
required: true
Expand Down Expand Up @@ -141,15 +137,14 @@ runs:
suffix=-devel${{ inputs.tag-suffix }}
- name: Docker meta for runtime
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_type == 'tag') }}
id: meta-runtime
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/${{ inputs.bake-target }}
tags: ${{ steps.set-docker-tags.outputs.tags }}
bake-target: docker-metadata-action-runtime
flavor: |
latest=${{ github.event_name == 'push' && github.ref_type == 'tag' }}
latest=auto
suffix=-runtime${{ inputs.tag-suffix }}
- name: Login to Docker Hub
Expand All @@ -159,27 +154,9 @@ runs:
password: ${{ inputs.dockerhub-token }}

- name: Build and Push to GitHub Container Registry
if: ${{ github.event_name == 'push' ||
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'registry') }}
uses: docker/bake-action@v5
with:
push: ${{ inputs.allow-push == 'true' }}
files: |
docker/docker-bake.hcl
${{ steps.meta-base.outputs.bake-file }}
${{ steps.meta-autoware-core.outputs.bake-file }}
${{ steps.meta-autoware-universe.outputs.bake-file }}
${{ steps.meta-devel.outputs.bake-file }}
${{ steps.meta-runtime.outputs.bake-file }}
provenance: false
set: |
${{ inputs.build-args }}
- name: Build only
uses: docker/bake-action@v5
with:
push: false
push: true
files: |
docker/docker-bake.hcl
${{ steps.meta-base.outputs.bake-file }}
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/docker-build-and-push-self-hosted.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: docker-build-and-push-self-hosted

on:
push:
branches:
- main
tags:
workflow_dispatch:
inputs:
artifacts-destination:
type: choice
description: Destination for the artifacts
options:
- registry
- tarball
default: tarball

jobs:
load-env:
Expand Down Expand Up @@ -58,8 +54,24 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
*.env
*.repos
.github/actions/docker-build-and-push/action.yaml
.github/workflows/docker-build-and-push*.yaml
ansible-galaxy-requirements.yaml
ansible/**
docker/**
- name: Build 'Autoware'
if: steps.author-check.outputs.author-found == 'true' || ${{ github.event_name == 'workflow_dispatch' }}
if: ${{ steps.author-check.outputs.author-found == 'true' ||
steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-and-push
with:
name: ${{ matrix.name }}
Expand All @@ -76,7 +88,6 @@ jobs:
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.head_ref }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: docker-build-and-push

on:
push:
branches:
- main
tags:
workflow_dispatch:
inputs:
artifacts-destination:
type: choice
description: Destination for the artifacts
options:
- registry
- tarball
default: tarball

jobs:
load-env:
Expand Down Expand Up @@ -58,8 +54,24 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
*.env
*.repos
.github/actions/docker-build-and-push/action.yaml
.github/workflows/docker-build-and-push*.yaml
ansible-galaxy-requirements.yaml
ansible/**
docker/**
- name: Build 'Autoware'
if: steps.author-check.outputs.author-found == 'true' || ${{ github.event_name == 'workflow_dispatch' }}
if: ${{ steps.author-check.outputs.author-found == 'true' ||
steps.changed-files.outputs.any_changed == 'true' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref_type == 'tag') }}
uses: ./.github/actions/docker-build-and-push
with:
name: ${{ matrix.name }}
Expand All @@ -76,7 +88,6 @@ jobs:
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.head_ref }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

<!--- CI Reports -->
<p align="center">
<a href="https://github.com/autowarefoundation/autoware/actions/workflows/build-main.yaml?query=branch%3Amain">
<img src="https://img.shields.io/github/actions/workflow/status/autowarefoundation/autoware/build-main.yaml?style=flat&label=build-main"
alt="Build Main CI" /></a>
<a href="https://github.com/autowarefoundation/autoware/actions/workflows/health-check.yaml?query=branch%3Amain">
<img src="https://img.shields.io/github/actions/workflow/status/autowarefoundation/autoware/health-check.yaml?style=flat&label=health-check"
alt="health-check CI" /></a>
<a href="https://app.codecov.io/gh/autowarefoundation/autoware.universe">
<img src="https://img.shields.io/codecov/c/gh/autowarefoundation/autoware.universe?style=flat&label=Coverage&logo=codecov&logoColor=white"
alt="Code Coverage" /></a>
Expand Down

0 comments on commit b8e7586

Please sign in to comment.