Skip to content

Commit

Permalink
golang: add docker login on test and benchmark workflows (#64)
Browse files Browse the repository at this point in the history
## Description

Add docker login on test and benchmark golang workflows

## Changes Made

- Add docker login on golang test workflow
- Add docker login on golang benchmark workflow

## Related Issues

N/A

## Checklist

- [x] I have used a PR title that is descriptive enough for a release
note.
- [x] I have tested these changes locally.
- [ ] I have added appropriate tests or updated existing tests.
- [ ] I have tested these changes on a dedicated VM or a customer VM
[name of the VM]
- [x] I have added appropriate documentation or updated existing
documentation.

---------

Co-authored-by: Federico M. Facca <chicco785@users.noreply.github.com>
Co-authored-by: Federico M. Facca <federico.facca@zaphiro.ch>
Co-authored-by: Bot <bot@zaphiro.ch>
  • Loading branch information
4 people authored Nov 29, 2023
1 parent cf1910f commit 38f2f85
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ jobs:
- name: Install gcov2lcov
run: |
go install github.com/jandelgado/gcov2lcov@latest
# We Login in GHCR to retrieve owned private images used in docker-compose
# This requires to set in the package settings read permission for the
# repository where the golang ci is running
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: |
make ci-test
Expand Down Expand Up @@ -121,6 +130,15 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
# We Login in GHCR to retrieve owned private images used in docker-compose
# This requires to set in the package settings read permission for the
# repository where the golang ci is running
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run benchmark
shell: bash
run: make ci-bench | tee output.txt
Expand Down
6 changes: 5 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ The repository includes:
- [release-notes](.github/workflows/release-notes.yaml) workflow: automatically
updates release notes using PR titles and labels.
- [golang](.github/workflows/golang.yaml) workflow: lint, test and benchmark Go
Applications
Applications. The workflow includes authentication to Github Container
Registry in case tests rely on private images. To retrieve the images, you
need also to set
[read permission](https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#ensuring-workflow-access-to-your-package)
for the repository on the package.
- [docker](.github/workflows/docker.yaml) workflow: build and push Docker images
- [clean-up-docker](.github/workflows/clean-up-docker.yaml) workflow: when a PR
is closed, related docker images and untagged ones are deleted
Expand Down
6 changes: 4 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# github-workflows Release Notes

## 0.0.2-dev - 2023-11-27
## 0.0.2-dev - 2023-11-29

### Features

- golang: add docker login on test and benchmark workflows (PR #64 by
@cosimomeli)
- docker workflow: add git and build information as build arguments (PR #63 by
@cosimomeli)
- add workflow to support license management (PR #58 by @chicco785)
Expand All @@ -30,8 +32,8 @@

### Bug Fixes

- pr-check workflow: pass correctly `input.labels` (PR #67 by @chicco785)
- markdown workflow: support correctly `.prettierignore` (PR #65 by @chicco785)
- pr-check workflow: pass correctly `input.labels` (PR #67 by @chicco785)
- markdown workflow: fix check to enable/disable spellchecker (PR #55 by
@chicco785)
- golang workflow: add shell configuration to enable `pipefail` for benchmark
Expand Down

0 comments on commit 38f2f85

Please sign in to comment.