-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds build and integrate targets (#55)
- Loading branch information
Showing
2 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# WARNING: If you modify this workflow, please update the documentation | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
target: | ||
description: | | ||
The target to run. | ||
required: true | ||
type: string | ||
aws_role_arn: | ||
description: | | ||
The ARN of the AWS role that will be assumed by the workflow. Only | ||
required when configuring a remote Earthly runner. | ||
required: false | ||
type: string | ||
aws_region: | ||
description: | | ||
The AWS region that will be used by the workflow. Only required when | ||
configuring a remote Earthly runner. | ||
required: false | ||
type: string | ||
ci_cli_version: | ||
description: | | ||
The version of the CI CLI to use. | ||
required: false | ||
type: string | ||
default: latest | ||
earthly_version: | ||
description: The version of Earthly to use. | ||
required: false | ||
type: string | ||
default: latest | ||
secrets: | ||
earthly_runner_address: | ||
description: | | ||
The address of the Earthly runner that will be used to build the | ||
Earthly files. | ||
required: false | ||
earthly_runner_secret: | ||
description: | | ||
The ID of the AWS secret holding Earthly remote runner credentials. | ||
This secret must contain the runner address and the necessary TLS | ||
certificates required to authenticate with it. If omitted, a remote | ||
Earthly runner will not be configured. | ||
required: false | ||
|
||
jobs: | ||
discover: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
json: ${{ steps.check.outputs.json }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup CI | ||
uses: input-output-hk/catalyst-ci/actions/setup@master | ||
with: | ||
cli_version: ${{ inputs.ci_cli_version }} | ||
earthly_skip_install: "true" | ||
- name: Discover Earthly files | ||
uses: input-output-hk/catalyst-ci/actions/discover@master | ||
id: discover | ||
with: | ||
targets: ${{ inputs.target }} | ||
- name: Check for empty output | ||
id: check | ||
run: | | ||
output=$(echo '${{ steps.discover.outputs.json }}' | jq -rc) | ||
if [ "$output" == "null" ]; then | ||
echo "json=[]" >> $GITHUB_OUTPUT | ||
else | ||
echo "json=$output" >> $GITHUB_OUTPUT | ||
fi | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: [discover] | ||
if: needs.discover.outputs.json != '[]' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
earthfile: ${{ fromJson(needs.discover.outputs.json) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup CI | ||
uses: input-output-hk/catalyst-ci/actions/setup@master | ||
with: | ||
aws_role_arn: ${{ inputs.aws_role_arn }} | ||
aws_region: ${{ inputs.aws_region }} | ||
cli_version: ${{ inputs.ci_cli_version }} | ||
earthly_version: ${{ inputs.earthly_version }} | ||
earthly_runner_secret: ${{ secrets.earthly_runner_secret }} | ||
- name: Run | ||
uses: input-output-hk/catalyst-ci/actions/run@master | ||
id: build | ||
with: | ||
earthfile: ${{ matrix.earthfile }} | ||
target: ${{ inputs.target }} | ||
runner_address: ${{ secrets.earthly_runner_address }} |