Skip to content

Commit

Permalink
Remove matrix builds with just one element
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Dec 17, 2024
1 parent ad5a731 commit facf253
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 54 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
docker-image:
- conda-store-server
platform:
- linux/amd64
- linux/arm64
Expand Down Expand Up @@ -65,24 +63,24 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
quansight/${{ matrix.docker-image }}
quay.io/quansight/${{ matrix.docker-image }}
quansight/conda-store-server
quay.io/quansight/conda-store-server
tags: |
type=ref,event=tag
type=sha
# we need this as we are setting the context to subproject directory
- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
cp .dockerignore conda-store-server/.dockerignore
shell: bash

- name: "Publish Docker image 🚀"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
context: "conda-store-server"
target: "dev"
file: "${{ matrix.docker-image }}/Dockerfile"
file: "conda-store-server/Dockerfile"
tags: |
${{ steps.meta.outputs.tags }}
push: true
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/build_pypi_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@ jobs:
build-package:
name: "Build & verify package"
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- "conda-store-server"
defaults:
run:
working-directory: ${{ matrix.directory }}
working-directory: conda-store-server
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: echo "Running on ${{ matrix.directory }}"
- run: echo "Running on conda-store-server"

- name: "Build and check package - ${{ matrix.directory }} 📦"
- name: "Build and check package - conda-store-server 📦"
uses: hynek/build-and-inspect-python-package@v2
id: baipp
with:
path: ${{ matrix.directory }}
upload-name-suffix: "-${{ matrix.directory }}"
path: conda-store-server
upload-name-suffix: "-conda-store-server"

- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }} and in artifact ${{ steps.baipp.outputs.artifact-name }}
43 changes: 13 additions & 30 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,23 @@ jobs:
build-package:
name: "Build & verify package"
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- "conda-store-server"
defaults:
run:
working-directory: ${{ matrix.directory }}
working-directory: conda-store-server
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: echo "Running on ${{ matrix.directory }}"
- run: echo "Running on conda-store-server"

- name: "Build and check package - ${{ matrix.directory }} 📦"
- name: "Build and check package - conda-store-server 📦"
uses: hynek/build-and-inspect-python-package@v2
id: baipp
with:
path: ${{ matrix.directory }}
upload-name-suffix: "-${{ matrix.directory }}"
path: conda-store-server
upload-name-suffix: "-conda-store-server"
attest-build-provenance-github: "true"

- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }} and in artifact ${{ steps.baipp.outputs.artifact-name }}
Expand All @@ -54,16 +50,11 @@ jobs:
if: github.repository_owner == 'conda-incubator' && github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
strategy:
matrix:
directory:
- "conda-store-server"

steps:
- name: "Download build artefacts 📥"
uses: actions/[email protected]
with:
name: Packages-${{ matrix.directory }}
name: Packages-conda-store-server
path: dist

- run: ls -lR dist/
Expand All @@ -84,19 +75,15 @@ jobs:
needs: build-package
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
strategy:
matrix:
directory:
- "conda-store-server"
defaults:
run:
working-directory: ${{ matrix.directory }}
working-directory: conda-store-server

steps:
- name: "Download build artefacts 📥"
uses: actions/[email protected]
with:
name: Packages-${{ matrix.directory }}
name: Packages-conda-store-server
path: dist

- name: "Upload to PyPI 🚀"
Expand All @@ -111,10 +98,6 @@ jobs:
needs: release-pypi
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
strategy:
matrix:
docker-image:
- conda-store-server
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4
Expand All @@ -125,7 +108,7 @@ jobs:
- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
cp .dockerignore conda-store-server/.dockerignore
shell: bash

- name: "Retrieve secret from Vault 🗝"
Expand Down Expand Up @@ -162,8 +145,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
quansight/${{ matrix.docker-image }}
quay.io/quansight/${{ matrix.docker-image }}
quansight/conda-store-server
quay.io/quansight/conda-store-server
tags: |
type=ref,event=tag
type=ref,event=branch
Expand All @@ -172,9 +155,9 @@ jobs:
- name: "Publish Docker image 🚀"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
context: "conda-store-server"
target: "prod"
file: "${{ matrix.docker-image }}/Dockerfile"
file: "conda-store-server/Dockerfile"
build-args: |
RELEASE_VERSION=${{github.ref_name}}
python_version=${{ env.PYTHON_VERSION_DEFAULT }}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/test_build_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
docker-image:
- conda-store
- conda-store-server
platform:
- linux/amd64
- linux/arm64
Expand All @@ -48,29 +45,29 @@ jobs:
- name: "Lint Dockerfiles 🔍"
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: ${{ matrix.docker-image }}/Dockerfile
dockerfile: conda-store-server/Dockerfile
output_format: tty
error_level: 0

- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
cp .dockerignore conda-store-server/.dockerignore
shell: bash

- name: "Add Docker metadata 📝"
id: meta
uses: docker/metadata-action@v5
with:
images: |
quansight/${{ matrix.docker-image }}
quansight/conda-store-server
tags: |
type=sha
- name: "Build Docker images 🐳"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
file: "${{ matrix.docker-image }}/Dockerfile"
context: "conda-store-server"
file: "conda-store-server/Dockerfile"
tags: |
${{ steps.meta.outputs.tags }}
target: "dev"
Expand Down

0 comments on commit facf253

Please sign in to comment.