Skip to content

test CI matrix

test CI matrix #3

Workflow file for this run

name: build
on:
workflow_call:
inputs:
skip_create_ami:
required: true
type: boolean
permissions:
id-token: write
contents: read
jobs:
compute-matrix:
runs-on: ubuntu-latest
outputs:
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute matrix
id: compute-matrix
run: |
MATRIX=$(ci/compute-matrix.sh)
echo "MATRIX=${MATRIX}" | tee --append ${GITHUB_OUTPUT}
build:
needs: compute-matrix
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
fail-fast: false
runs-on: ubuntu-latest
container:
image: hashicorp/packer:latest
steps:
- run:
- run: |
echo "DRIVER_VERSION=$DRIVER_VERSION"
echo "OS=$OS"
echo "RUNNER_VERSION=$RUNNER_VERSION"
echo "ARCH=$ARCH"
echo "ENV=$ENV"
echo "SKIP_CREATE_AMI=$SKIP_CREATE_AMI"
echo "DOMAIN=$DOMAIN"
echo "PACKER_SOURCE=$PACKER_SOURCE"
env:
DRIVER_VERSION: ${{ matrix.DRIVER_VERSION }}
OS: ${{ matrix.OS }}
RUNNER_VERSION: ${{ matrix.RUNNER_VERSION }}
ARCH: ${{ matrix.ARCH }}
ENV: ${{ matrix.ENV }}
SKIP_CREATE_AMI: ${{ inputs.skip_create_ami }}
DOMAIN: ${{ matrix.domain }}
PACKER_SOURCE: ${{ matrix.packer_source }}
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ vars.PACKER_AWS_ROLE_ARN }}
# aws-region: ${{ vars.AWS_REGION }}
# - uses: actions/checkout@v4
# - name: Build image
# run: |
# packer init .
# packer build \
# -var "skip_create_ami=${{ inputs.skip_create_ami }}" \
# -var "driver_version=${{ matrix.DRIVER_VERSION }}" \
# .