Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

reviews:
profile: "assertive"
auto_title_instructions: |
Format: <type>(<scope>): <subject>
<scope> is optional
Type: chore, docs, feat, fix, refactor, style, or test.
fail_commit_status: true
sequence_diagrams: false
suggested_reviewers: false
poem: false
auto_review:
labels:
- "!no bot reviewer"
pre_merge_checks:
docstrings:
mode: off
title:
mode: off
tools:
hadolint:
enabled: true
markdownlint:
enabled: true
shellcheck:
enabled: true
language: "en-US"
16 changes: 16 additions & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: 0.2
dictionaryDefinitions:
- name: project-words
path: ./.cspell/project-words.txt
addWords: true
- name: third-party-words
path: ./.cspell/third-party-words.txt
addWords: true
dictionaries:
- project-words
- third-party-words
useGitignore: true
ignorePaths:
- /.cspell
1 change: 1 addition & 0 deletions .cspell/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iplaylf
9 changes: 9 additions & 0 deletions .cspell/third-party-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
buildx
coderabbit
coderabbitai
devcontainers
dockerfiles
docstrings
mapfile
pipefail
shellcheck
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@coderabbitai summary

## Quick Notes

- **Title**: Set the PR title to `@coderabbitai` to have the bot generate one for you.

- **Review**: The bot reviews PRs by default. To opt out, add the `no bot reviewer` label.
93 changes: 93 additions & 0 deletions .github/workflows/pre-merge-to-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: On Pre-Merge to Master

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [master]

jobs:
discover-images:
name: Discover Images
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.collect.outputs.matrix }}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Collect Image Metadata
id: collect
run: |
set -euo pipefail

mapfile -t dockerfiles < <(find images -type f -name 'Dockerfile' -print | sort)
if [ "${#dockerfiles[@]}" -eq 0 ]; then
echo 'matrix=[]' >>"$GITHUB_OUTPUT"
exit 0
fi

matrix_json=$(
for dockerfile in "${dockerfiles[@]}"; do
[ -z "${dockerfile}" ] && continue
context=$(dirname "${dockerfile}")
name=$(basename "${context}")
jq -nc \
--arg name "${name}" --arg context "${context}" --arg file "${dockerfile}" \
'{name: $name, context: $context, file: $file}'
done | jq -sc '.'
)

echo "Discovered matrix: ${matrix_json}"
echo "matrix=${matrix_json}" >>"$GITHUB_OUTPUT"

build-images:
name: Build ${{ matrix.image.name }} Image
needs: discover-images
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
strategy:
matrix:
image: ${{ fromJson(needs.discover-images.outputs.matrix) }}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build ${{ matrix.image.name }} Image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image.context }}
file: ${{ matrix.image.file }}
push: false
provenance: false
cache-from: type=gha,scope=${{ github.workflow }}-${{ matrix.image.name }}
cache-to: type=gha,scope=${{ github.workflow }}-${{ matrix.image.name }},mode=max

report-build-status:
name: Report Image Build Status
needs: build-images
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Report Build Status
run: |
result='${{ needs.build-images.result }}'
level="notice"

if [ "${result}" != "success" ]; then
level="error"
fi

echo "::${level}::Image build job outcome: ${result}"
if [ "${result}" != "success" ]; then
exit 1
fi
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-azuretools.vscode-containers",
"streetsidesoftware.code-spell-checker",
"redhat.vscode-yaml"
]
}
1 change: 1 addition & 0 deletions images/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mcr.microsoft.com/devcontainers/base
17 changes: 9 additions & 8 deletions images/dotnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM mcr.microsoft.com/devcontainers/base:latest AS builder

WORKDIR /builder

ADD --chown=vscode:vscode --chmod=500 https://dot.net/v1/dotnet-install.sh .


FROM mcr.microsoft.com/devcontainers/base:latest

USER vscode
ENV DOTNET_ROOT=/home/vscode/.dotnet
ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

WORKDIR /tmp/dotnet-install-temp

ADD --chown=vscode:vscode https://dot.net/v1/dotnet-install.sh .

RUN chmod +x dotnet-install.sh

ARG SDK_VERSION=LTS

RUN ./dotnet-install.sh --channel $SDK_VERSION
RUN rm -rf /tmp/dotnet-install-temp
RUN --mount=type=bind,from=builder,source=/builder/dotnet-install.sh,target=/builder/dotnet-install.sh \
/builder/dotnet-install.sh --channel $SDK_VERSION
Loading