forked from containers/libhvee
-
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.
chore: add builder flow fix containers#80
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
- Loading branch information
1 parent
710e0e6
commit bc6d888
Showing
5 changed files
with
139 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: builder | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
|
||
env: | ||
OCI_E2E_NAME: libhvee-e2e | ||
CORRELATE: ${{ github.sha }} | ||
|
||
jobs: | ||
save-gh-context: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Correlate builds | ||
shell: bash | ||
env: | ||
GH_CONTEXT: ${{ toJSON(github) }} | ||
run: echo $GH_CONTEXT > gh_context.json | ||
|
||
- name: Upload GH context as an artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gh_context | ||
path: ./gh_context.json | ||
|
||
build-oci-e2e: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build and archive e2e image | ||
run: | | ||
VERSION=${{ env.CORRELATE}} make build-oci-e2e | ||
podman save -o ${{ env.OCI_E2E_NAME }}.tar quay.io/rhqp/${{ env.OCI_E2E_NAME}}:v${{ env.CORRELATE }} | ||
- name: Upload e2e flat image as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: libhvee-e2e-v${{ env.CORRELATE }} | ||
path: libhvee-e2e.tar | ||
|
||
build-executables: | ||
runs-on: windows-2022 | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.18' | ||
|
||
- name: Build libhvee executables | ||
run: make build | ||
|
||
- name: Upload libhvee executables as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: libhvee-v${{ env.CORRELATE }} | ||
path: bin/*.exe |
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
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,29 @@ | ||
# e2e | ||
|
||
TBC | ||
|
||
## Container | ||
|
||
Build container image | ||
|
||
```bash | ||
make build-oci-e2e | ||
``` | ||
|
||
Sample for running the container with e2e on remote target | ||
|
||
```bash | ||
podman run --rm -it --name libhvee-e2e \ | ||
-e TARGET_HOST=$(cat host) \ | ||
-e TARGET_HOST_USERNAME=$(cat username) \ | ||
-e TARGET_HOST_KEY_PATH=/data/id_rsa \ | ||
-e TARGET_FOLDER=libhvee-e2e \ | ||
-e TARGET_RESULTS=libhvee-e2e.xml \ | ||
-e OUTPUT_FOLDER=/data \ | ||
-e DEBUG=true \ | ||
-v $PWD:/data:z \ | ||
quay.io/rhqp/libhvee-e2e:v0.0.1 \ | ||
libhvee-e2e/run.ps1 \ | ||
-targetFolder libhvee-e2e \ | ||
-junitResultsFilename libhvee-e2e.xml | ||
``` |
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,23 @@ | ||
|
||
FROM registry.access.redhat.com/ubi9/go-toolset:1.18 as builder | ||
|
||
COPY . . | ||
|
||
ARG OS | ||
ARG ARCH | ||
|
||
RUN GOOS=${OS} GOARCH=${ARCH} go test -v test/e2e/*.go -c -o ./build/libhvee-e2e.exe | ||
|
||
FROM quay.io/rhqp/deliverest:v0.0.3 | ||
|
||
ARG OS | ||
ARG ARCH | ||
|
||
ENV ASSETS_FOLDER=/opt/libhvee-e2e \ | ||
OS=${OS} \ | ||
ARCH=${ARCH} | ||
|
||
# LABEL org.opencontainpoders.image.authors="Adrian Riobo<[email protected]>" | ||
|
||
COPY --from=builder /opt/app-root/src/build/libhvee-e2e.exe ${ASSETS_FOLDER}/ | ||
COPY oci/e2e/run.ps1 ${ASSETS_FOLDER}/ |
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,10 @@ | ||
param( | ||
[Parameter(Mandatory,HelpMessage='folder on target host where assets are copied')] | ||
$targetFolder, | ||
[Parameter(Mandatory,HelpMessage='junit results filename')] | ||
$junitResultsFilename | ||
) | ||
|
||
# Run e2e | ||
$env:PATH="$env:PATH;$env:HOME\$targetFolder;" | ||
libhvee-e2e.exe --ginkgo.vv --ginkgo.junit-report="$targetFolder/$junitResultsFilename" |