Skip to content

Commit

Permalink
Skip lint
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Sep 14, 2024
1 parent 9be4c22 commit 1dcef2e
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 1 deletion.
102 changes: 102 additions & 0 deletions .github/workflows/nvidia-l4t-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: self-hosted

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# Job to run change detection
changes:
runs-on: [self-hosted]
outputs:
images: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
nvidia/l4t-base: 'nvidia/l4t-base/**'
build:
needs: changes
strategy:
matrix:
image: ${{ fromJSON(needs.changes.outputs.images) }}
if: ${{ needs.changes.outputs.images != '[]' && needs.changes.outputs.images != '' }}
runs-on: [self-hosted]
defaults:
run:
working-directory: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4

- name: Install QEMU static binaries
uses: docker/setup-qemu-action@v3

# Intentionally not using docker/setup-bake, configured in Chef

- name: Build locally for testing
uses: docker/bake-action@v4
with:
workdir: ${{ matrix.image }}
targets: local
load: true

- name: Run tests on the image with cinc-auditor
shell: bash
working-directory: ${{ matrix.image }}
run: |
json_data="$(docker buildx bake local --print 2>/dev/null)"
test_image=$(echo "$json_data" | jq -r '.target | to_entries[0].value | .tags[0]')
$(git rev-parse --show-toplevel)/bin/test-matrix.sh $test_image
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/bake-action@v4
with:
workdir: ${{ matrix.image }}
push: ${{ github.event_name != 'pull_request' }}

- name: Get the image name
if: ${{ github.event_name != 'pull_request' }}
id: image_name
shell: bash
working-directory: ${{ matrix.image }}
run: |
echo "image_name=$($(git rev-parse --show-toplevel)/bin/image-name.sh)" >> $GITHUB_ENV
- name: Get the image description
if: ${{ github.event_name != 'pull_request' }}
id: image_description
shell: bash
working-directory: ${{ matrix.image }}
run: |
echo "image_description=$($(git rev-parse --show-toplevel)/bin/image-description.sh)" >> $GITHUB_ENV
- name: Get the image readme filepath
if: ${{ github.event_name != 'pull_request' }}
id: image_readme_filepath
shell: bash
working-directory: ${{ matrix.image }}
run: |
echo "image_readme_filepath=$($(git rev-parse --show-toplevel)/bin/image-readme.sh)" >> $GITHUB_ENV
- name: Update Docker Hub Description
if: ${{ github.event_name != 'pull_request' }}
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_DESCRIPTION_PASSWORD }}
repository: boxcutter/${{ env.image_name }}
short-description: ${{ env.image_description }}
readme-filepath: ${{ env.image_readme_filepath }}
1 change: 0 additions & 1 deletion .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
with:
base: ${{ github.ref }}
filters: |
nvidia/l4t-base: 'nvidia/l4t-base/**'
ros/humble/ubuntu/jammy: 'ros/humble/ubuntu/jammy/**'
ros/iron/ubuntu/jammy: 'ros/iron/ubuntu/jammy/**'
ros/jazzy/ubuntu/noble: 'ros/jazzy/ubuntu/noble/**'
Expand Down

0 comments on commit 1dcef2e

Please sign in to comment.