-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix devcontainer features installation (#13)
- Loading branch information
Showing
11 changed files
with
131 additions
and
62 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json | ||
# Copyright (c) 2022 Robert Bosch GmbH and Microsoft Corporation | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: pre-commit | ||
description: run pre-commit | ||
inputs: | ||
extra_args: | ||
description: Options to pass to pre-commit run | ||
required: false | ||
default: "--all-files" | ||
runs: | ||
using: composite | ||
steps: | ||
- run: python -m pip install pre-commit | ||
shell: bash | ||
- run: python -m pip freeze --local | ||
shell: bash | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }} | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,22 +33,32 @@ jobs: | |
build-image: | ||
strategy: | ||
matrix: | ||
language: [Python, Cpp] | ||
language: [python, cpp] | ||
|
||
name: "Building image" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Run Linters | ||
uses: ./.github/actions/pre-commit-action | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
version: v0.9.0 | ||
|
||
- name: Get image tag | ||
id: get-tag | ||
shell: bash | ||
run: | | ||
TAG=${{ github.sha }} | ||
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
TAG=latest | ||
fi | ||
echo "tag=${TAG}" >> $GITHUB_OUTPUT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
|
@@ -57,26 +67,12 @@ jobs: | |
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository }}/${{ matrix.language }} | ||
tags: | | ||
type=sha | ||
type=ref,event=tag | ||
type=semver,pattern={{version}} | ||
type=edge | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: "Build image" | ||
- name: Build image and push | ||
id: image_build | ||
uses: docker/build-push-action@v3 | ||
uses: devcontainers/[email protected] | ||
with: | ||
push: true | ||
context: "." | ||
file: ./Dockerfiles/${{ matrix.language }}/Dockerfile | ||
platforms: linux/amd64, linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
imageName: ghcr.io/${{ github.repository }}/${{ matrix.language }} | ||
imageTag: ${{ steps.get-tag.outputs.tag }} | ||
push: always | ||
platform: linux/amd64,linux/arm64 | ||
subFolder: ./Dockerfiles/${{ matrix.language }}/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-json |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "Base Container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "../../.." | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "Base Container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "../../.." | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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