-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): add GitHub Actions and Docker configuration #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
25db954
improve images/dotnet/Dockerfile
iplaylf2 9129898
add lint
iplaylf2 57d67ae
rename .cspell.yaml
iplaylf2 f0fe763
add .coderabbit.yaml
iplaylf2 052a045
add images/base/Dockerfile
iplaylf2 89b1e86
add .github/pull_request_template.md
iplaylf2 6042e9a
add workflow
iplaylf2 d187ba2
fix
iplaylf2 cb83bc6
fix
iplaylf2 27d0655
improve collect
iplaylf2 c0e4d22
fix
iplaylf2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,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" |
This file contains hidden or 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,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 |
This file contains hidden or 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 @@ | ||
| iplaylf |
This file contains hidden or 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,9 @@ | ||
| buildx | ||
| coderabbit | ||
| coderabbitai | ||
| devcontainers | ||
| dockerfiles | ||
| docstrings | ||
| mapfile | ||
| pipefail | ||
| shellcheck |
This file contains hidden or 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,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. | ||
This file contains hidden or 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,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 | ||
iplaylf2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 | ||
iplaylf2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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,7 @@ | ||
| { | ||
| "recommendations": [ | ||
| "ms-azuretools.vscode-containers", | ||
| "streetsidesoftware.code-spell-checker", | ||
| "redhat.vscode-yaml" | ||
| ] | ||
| } |
This file contains hidden or 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 @@ | ||
| FROM mcr.microsoft.com/devcontainers/base | ||
iplaylf2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -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 . | ||
iplaylf2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.