Skip to content
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
47 changes: 47 additions & 0 deletions .github/workflows/build_base_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Base Test

on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
workflow_dispatch:

jobs:
BUILD_BASE_IMAGE:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6

- uses: jitterbit/get-changed-files@v1
id: changed-files
continue-on-error: true
with:
format: space-delimited
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push firstfloor/photon:5.0 multi-arch manifest
run: |
set -x
if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ] && [ -n "${{ secrets.DOCKERHUB_TOKEN }}" ]; then
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker buildx build --platform linux/amd64,linux/arm64 \
-f multi_arch/Dockerfile -t firstfloor/photon:5.0 --push .
docker logout
else
echo "Secrets not available, building without push"
docker buildx build --platform linux/amd64,linux/arm64 \
-f multi_arch/Dockerfile -t firstfloor/photon:5.0 .
fi

9 changes: 0 additions & 9 deletions .github/workflows/multiarch_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ jobs:
echo "Building for OS: linux, Arch: ${{ matrix.arch }} on Native Runner: ${{ matrix.runner }}"
go build -v -o ldaputils-${{ matrix.arch }}

- name: Run Tests
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
echo "Running tests natively on ${{ matrix.arch }}"
go test -v ./...

# Upload the compiled binary as a workflow artifact
- name: Upload Binary Artifact
uses: actions/upload-artifact@v4
Expand Down
9 changes: 9 additions & 0 deletions multi_arch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM photon:5.0

RUN tdnf install photon-repos -y \
&& sed -i 's/enabled\s*=.*/enabled=0/g' /etc/yum.repos.d/*.repo \
&& sed -i 's/enabled\s*=.*/enabled=1/g' /etc/yum.repos.d/photon-snapshot.repo \
&& tdnf clean all \
&& tdnf --disablerepo="*" --enablerepo="photon-snapshot" makecache \
&& tdnf --disablerepo="*" --enablerepo="photon-snapshot" update -y \
&& tdnf clean all
Loading