-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from zMynxx/feature/test-cd-1
Feature/test cd 1
- Loading branch information
Showing
9 changed files
with
72 additions
and
81 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 |
---|---|---|
|
@@ -33,7 +33,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
ref: ${{ github.pull_request.head.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
|
@@ -42,12 +42,6 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build locally | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -56,7 +50,7 @@ jobs: | |
platforms: linux/amd64 | ||
push: false | ||
load: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:${{ github.sha }} | ||
tags: release:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
|
@@ -66,7 +60,7 @@ jobs: | |
--interactive \ | ||
--rm \ | ||
--volume ./project-demo:/project \ | ||
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:${{ github.sha }} \ | ||
release:${{ github.sha }} \ | ||
ceedling release | ||
- name: Semantic Versioning | ||
|
@@ -80,7 +74,7 @@ jobs: | |
id: downcase | ||
shell: bash | ||
env: | ||
PR_BODY: ${{ github.event.pull_request.body }} | ||
PR_BODY: ${{ github.pull_request.body }} | ||
run: echo "pr_body_lowercase=${PR_BODY,,}" >> $GITHUB_OUTPUT | ||
|
||
- name: Parse the body for any '#major' or '#minor' keywords | ||
|
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 |
---|---|---|
|
@@ -24,12 +24,6 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build locally | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -38,7 +32,7 @@ jobs: | |
platforms: linux/amd64 | ||
push: false | ||
load: true | ||
tags: ${{ vars.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_USERNAME }}:${{ github.sha }} | ||
tags: tests:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
|
@@ -48,5 +42,5 @@ jobs: | |
--interactive \ | ||
--rm \ | ||
--volume ./project-demo:/project \ | ||
${{ vars.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_USERNAME }}:${{ github.sha }} \ | ||
tests:${{ github.sha }} \ | ||
ceedling test:all |
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ name: Publish | |
on: | ||
# Publish a new image to Dockerhub on changes to Dockerfile | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- Dockerfile.ubuntu | ||
|
||
|
@@ -13,16 +15,8 @@ permissions: | |
contents: write | ||
|
||
jobs: | ||
check: | ||
name: check pr status | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: check if PR is merged | ||
uses: zmynx/github-actions/.github/actions/git/check-merge@feature/gha | ||
|
||
cd: | ||
name: publish-dockerhub | ||
needs: [check] | ||
name: Docker Ceedling test:all | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
|
@@ -40,6 +34,12 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }} | ||
|
||
# In case of a new image I'd like to publish | ||
- name: Publish image to DockerHub | ||
uses: docker/[email protected] | ||
|
@@ -48,7 +48,9 @@ jobs: | |
file: Dockerfile.ubuntu | ||
platforms: linux/amd64 | ||
push: true | ||
labels: ${{ steps.meta.outputs.labels }} | ||
tags: | | ||
${{ steps.meta.outputs.tags }} | ||
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:22.04-v0.32.0-d76db35-${{ github.sha }} | ||
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:latest | ||
cache-from: type=gha | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ jobs: | |
name: Trunk Check Runner | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write # For caching | ||
checks: write # For trunk to post annotations | ||
contents: read # For repo checkout | ||
|
||
|
@@ -22,3 +23,5 @@ jobs: | |
|
||
- name: Trunk Check | ||
uses: trunk-io/[email protected] | ||
with: | ||
check-mode: populate_cache_only |
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,39 @@ | ||
Checks: >- | ||
bugprone-*, | ||
cppcoreguidelines-*, | ||
google-*, | ||
misc-*, | ||
modernize-*, | ||
performance-*, | ||
readability-*, | ||
-bugprone-lambda-function-name, | ||
-bugprone-reserved-identifier, | ||
-cppcoreguidelines-avoid-goto, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-avoid-non-const-global-variables, | ||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
-cppcoreguidelines-pro-type-vararg, | ||
-google-readability-braces-around-statements, | ||
-google-readability-function-size, | ||
-misc-no-recursion, | ||
-modernize-return-braced-init-list, | ||
-modernize-use-nodiscard, | ||
-modernize-use-trailing-return-type, | ||
-performance-unnecessary-value-param, | ||
-readability-magic-numbers, | ||
CheckOptions: | ||
- key: readability-function-cognitive-complexity.Threshold | ||
value: 100 | ||
- key: readability-function-cognitive-complexity.IgnoreMacros | ||
value: true | ||
# Set naming conventions for your style below (there are dozens of naming settings possible): | ||
# See https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html | ||
# - key: readability-identifier-naming.ClassCase | ||
# value: CamelCase | ||
# - key: readability-identifier-naming.NamespaceCase | ||
# value: lower_case | ||
# - key: readability-identifier-naming.PrivateMemberSuffix | ||
# value: _ | ||
# - key: readability-identifier-naming.StructCase | ||
# value: CamelCase |
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ runtimes: | |
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) | ||
lint: | ||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- git-diff-check | ||
- [email protected] | ||
|
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
FROM ubuntu:22.04 as base | ||
|
||
MAINTAINER [email protected] | ||
LABEL maintainer.description='C Development environment' | ||
LABEL ceedling.version=v0.31.1 | ||
LABEL maintainer.description='C Development environment with ceedling, cmock unity, and doxygen' | ||
LABEL ceedling.version=ceedling-0.32.0-d76db35 | ||
LABEL unity.version=2.5.4 | ||
LABEL cmock.version=2.5.4 | ||
LABEL cexception.version=1.3.3 | ||
LABEL doxygen.version=v1.9.1 | ||
|
||
# Install the required packages | ||
|
@@ -45,12 +48,11 @@ RUN apt-get clean &&\ | |
# RUN timedatectl set-timezone $TZ | ||
|
||
# Install rbenv-build | ||
#RUN curl --fail --silent --show-error --location https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | ||
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | ||
RUN curl --fail --silent --show-error --location https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | ||
ENV PATH="$PATH:/root/.rbenv/bin:/root/.rbenv/shims" | ||
|
||
# Validate rbenv using rbev-doctor | ||
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash | ||
RUN curl --fail --silent --show-error --location https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor | bash | ||
RUN echo 'eval "$(~/.rbenv/bin/rbenv init -)"' >> /etc/profile.d/rbenv.sh | ||
|
||
# Install rbenv and set the desired version | ||
|
@@ -63,29 +65,7 @@ RUN rbenv install $RBENV_VERSION &&\ | |
COPY ./ceedling-0.32.0-d76db35.gem ceedling-0.32.0-d76db35.gem | ||
RUN gem install constructor deep_merge thor | ||
RUN gem install --local ./ceedling-0.32.0-d76db35.gem | ||
HEALTHCHECK --interval=35s --timeout=4s --retries=2 CMD ceedling version || exit 1 | ||
|
||
################################################################################ | ||
# Create a final stage for running your application. | ||
# | ||
# The following commands copy the output from the "build" stage above and tell | ||
# the container runtime to execute it when the image is run. Ideally this stage | ||
# contains the minimal runtime dependencies for the application as to produce | ||
# the smallest image possible. This often means using a different and smaller | ||
# image than the one used for building the application, but for illustrative | ||
# purposes the "base" image is used here. | ||
# FROM base AS final | ||
# | ||
# # Create a non-privileged user that the app will run under. | ||
# # See https://docs.docker.com/go/dockerfile-user-best-practices/ | ||
# ARG UID=10001 | ||
# ARG USER=ubuntu | ||
# ENV USER $USER | ||
# RUN useradd \ | ||
# --uid "${UID}" \ | ||
# --create-home \ | ||
# --shell "/bin/bash" \ | ||
# --groups sudo \ | ||
# $USER | ||
# USER $USER | ||
WORKDIR /project | ||
CMD 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 |
---|---|---|
|
@@ -20,9 +20,11 @@ services: | |
args: | ||
- RBENV_VERSION=3.3.0 | ||
labels: | ||
- [email protected] | ||
- maintainer.description=C Development environment | ||
- maintainer.description='C Development environment with ceedling, cmock unity, and doxygen' | ||
- ceedling.version=ceedling-0.32.0-d76db35 | ||
- unity.version=2.5.4 | ||
- cmock.version=2.5.4 | ||
- cexception.version=1.3.3 | ||
- doxygen.version=v1.9.1 | ||
tty: true | ||
stdin_open: true | ||
|