Skip to content
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

Feature/test cd #7

Merged
merged 5 commits into from
Feb 28, 2024
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
14 changes: 5 additions & 9 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ permissions:
contents: write
packages: write

env:
TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:22.04-v0.32.0-d76db35
LATEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:latest

jobs:
check:
name: check pr status
Expand Down Expand Up @@ -58,7 +54,7 @@ jobs:
platforms: linux/amd64
push: false
load: true
tags: ${{ env.TEST_TAG }}
tags: ${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -68,7 +64,7 @@ jobs:
--interactive \
--rm \
--volume ./project-demo:/project \
${{ env.TEST_TAG }} \
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:${{ github.sha }} \
ceedling release

- name: Semantic Versioning
Expand Down Expand Up @@ -96,7 +92,7 @@ jobs:
uses: softprops/[email protected]
with:
files: /project-demo/build/artifacts/release/MyApp.out
tag_name: ${{ steps.new_tag.outputs.new_tag }}
tag_name: "${{ format('{0}{1}', 'v', steps.new_tag.outputs.new_tag) }}"

- name: Git Config
uses: zmynx/github-actions/.github/actions/git/git-config@feature/gha
Expand All @@ -114,7 +110,7 @@ jobs:
platforms: linux/amd64
push: true
tags: |
${{ vars.DOCKERHUB_REPO }}:${{ steps.new_tag.outputs.new_tag }}
${{ vars.DOCKERHUB_REPO }}:latest
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:22.04-v${{ steps.new_tag.outputs.new_tag }}
${{ secrets.DOCKERHUB_USERNAME}}/${{ vars.DOCKERHUB_REPO }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
19 changes: 7 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,25 @@ on:
branches:
- "main"

env:
TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:test-22.04-v0.32.0-d76db35
LATEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:latest

jobs:
docker-test:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- 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:
Expand All @@ -41,15 +36,15 @@ jobs:
platforms: linux/amd64
push: false
load: true
tags: ${{ env.TEST_TAG }}
tags: ${{ vars.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_USERNAME }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run all Tests using Docker
run: |
docker run \
--interactive \
--rm \
--volume ./project-demo:/project \
${{ env.TEST_TAG }} \
${{ vars.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_USERNAME }}:${{ github.sha }} \
ceedling test:all
Loading