chore: try to separate matrix

This commit is contained in:
Daan Selen
2025-11-27 23:44:41 +01:00
parent 7f73181ecc
commit f48676472c
2 changed files with 29 additions and 14 deletions

View File

@@ -25,9 +25,11 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
variant: variant:
- name: modern - name: amd64
arch: linux/amd64,linux/arm64 arch: linux/amd64
- name: legacy - name: arm64
arch: linux/arm64
- name: armv7
arch: linux/arm/v7 arch: linux/arm/v7
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -68,7 +70,7 @@ jobs:
type=sha,format=short,prefix= type=sha,format=short,prefix=
- name: replace psycopg binary to c version for arm/v7 - name: replace psycopg binary to c version for arm/v7
if: ${{ matrix.variant.name == 'legacy' }} if: ${{ matrix.variant.name == 'armv7' }}
run: | run: |
echo "TUNING PSYCOPG FOR ${{ matrix.variant.name }}" echo "TUNING PSYCOPG FOR ${{ matrix.variant.name }}"
sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" ./src/requirements.txt sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" ./src/requirements.txt
@@ -83,7 +85,7 @@ jobs:
context: . context: .
file: ./docker/Dockerfile file: ./docker/Dockerfile
push: false push: false
outputs: type=oci,dest=/dist/docker-${{ matrix.variant.name }}.tar outputs: type=docker,dest=/dist/image-${{ matrix.variant.name }}.tar
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.variant.arch }} platforms: ${{ matrix.variant.arch }}
@@ -91,12 +93,12 @@ jobs:
- name: Upload docker image as artifact - name: Upload docker image as artifact
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v5
with: with:
name: docker-image-${{ matrix.variant.name }} name: image-${{ matrix.variant.name }}
path: /dist/docker-${{ matrix.variant.name }}.tar path: /dist/image-${{ matrix.variant.name }}.tar
docker_merge: docker_merge:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: docker_build # needs: docker_build
steps: steps:
- name: Make workspace directory - name: Make workspace directory
run: mkdir -p /workspace run: mkdir -p /workspace
@@ -106,23 +108,35 @@ jobs:
with: with:
path: /workspace path: /workspace
- name: Install unzip - name: Install dependencies
run: | run: |
apt-get update && apt-get install -y unzip mv /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/microsoft-prod.list.disabled
apt-get update && apt-get install -y unzip tree
- name: List workspace contents - name: List workspace contents
run: | run: |
cd /workspace cd /workspace
for zip in $(find ./ -type f -name "docker*.zip"); do
echo "Extracting"
for zip in $(find ./ -type f -name "image-*.zip"); do
echo "Found zip: $zip"; echo "Found zip: $zip";
unzip $zip unzip $zip
done done
ls -lah ls -lah && tree
echo "Loading"
for tar in $(find ./ -type f -name "image-*.tar"); do
echo "Found zip: $tar";
docker load -i $tar
done
docker images
docker_scan: docker_scan:
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: docker_merger needs: docker_merge
steps: steps:
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*.tar
.vscode .vscode
.DS_Store .DS_Store
.idea .idea