Add paper citation to README (#282) #158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
jobs: | |
configure: | |
name: Configure | |
runs-on: ubuntu-20.04 | |
outputs: | |
base_image: ${{ steps.compute-base-image.outputs.base_image }} | |
build_base_image: ${{ steps.should-build-base-image.outputs.answer }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
if: github.event_name != 'workflow_dispatch' | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v6 | |
- name: Compute last successfully built commit | |
uses: nrwl/last-successful-commit-action@v1 | |
id: last-commit | |
with: | |
branch: ${{ steps.branch-name.outputs.current_branch }} | |
workflow_id: 'ci.yaml' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
if: github.event_name != 'workflow_dispatch' | |
- name: Check base image files for changes since last commit | |
id: base-image-files-in-last-commit | |
uses: tj-actions/[email protected] | |
with: | |
files: tools/setup/* | |
base_sha: ${{ steps.last-commit.outputs.commit_hash }} | |
sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
if: github.event_name != 'workflow_dispatch' | |
- name: Check if base image needs to be (re)built | |
id: should-build-base-image | |
run: | | |
echo '::set-output name=answer::true' | |
if: | | |
(github.event_name == 'workflow_dispatch') || | |
(steps.base-image-files-in-last-commit.outputs.any_changed == 'true') | |
- name: Check base image files for changes since branching | |
id: base-image-files-full-diff | |
uses: tj-actions/[email protected] | |
with: | |
files: tools/setup/* | |
use_fork_point: true | |
if: github.event_name != 'workflow_dispatch' | |
- name: Compute base image name | |
id: compute-base-image | |
run: | | |
suffix="latest" | |
if ! ${{ steps.branch-name.outputs.is_default }}; then | |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
suffix="$GITHUB_REF_SLUG" | |
fi | |
if [[ "${{ steps.base-image-files-full-diff.outputs.any_changed }}" == "true" ]]; then | |
suffix="$GITHUB_REF_SLUG" | |
fi | |
fi | |
echo "::set-output name=base_image::osrf/lrauv:gz-garden-${suffix}" | |
build-base-image: | |
name: Build Gazebo Garden image | |
runs-on: ubuntu-20.04 | |
needs: configure | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_READ_WRITE }} | |
- name: Build and push Gazebo Garden image | |
uses: docker/build-push-action@v3 | |
with: | |
file: tools/setup/Dockerfile | |
target: garden | |
tags: ${{ needs.configure.outputs.base_image }} | |
push: true | |
if: ${{ needs.configure.outputs.build_base_image }} | |
build-and-test: | |
name: Build and test lrauv code | |
needs: [configure, build-base-image] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Build LRAUV image | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: BASE_IMAGE=${{ needs.configure.outputs.base_image }} | |
file: tools/setup/Dockerfile | |
target: lrauv-base | |
tags: lrauv-base | |
push: false | |
- name: Build and run tests | |
run: docker run --rm -t lrauv-base | |
if: always() |