Build and test images #7438
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
name: Build and test images | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
release: | |
types: [published] | |
schedule: | |
- cron: "0 0 * * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
generate_matrix: | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' || github.event_name == 'pull_request' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Set up Pipenv | |
run: | | |
pip install pip pipenv | |
pipenv sync | |
- name: Run script | |
id: run_script | |
run: echo "::set-output name=matrix::$(pipenv run python matrix_generator.py)" | |
outputs: | |
matrix: ${{ steps.run_script.outputs.matrix }} | |
build: | |
runs-on: ubuntu-latest | |
if: (github.actor != 'dependabot[bot]' || github.event_name == 'pull_request') && fromJSON(needs.generate_matrix.outputs.matrix).include[0] | |
needs: generate_matrix | |
strategy: | |
matrix: ${{fromJSON(needs.generate_matrix.outputs.matrix)}} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Set up Pipenv | |
run: | | |
pip install pip pipenv | |
pipenv sync | |
- name: Build and tests images | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
pipenv run python image_builder.py build -d --image ${{ matrix.image }} --version ${{ matrix.version }} |