Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
with:
skip_docker: 'true'
skip_github: 'true'
skip_docker: "true"
skip_github: "true"
skip_earthly_install: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
skip_earthly_satellite: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
- name: Discovery
Expand Down
73 changes: 43 additions & 30 deletions actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,47 @@ inputs:
skip_aws:
description: If true, skip authenticating with AWS and configuring ECR
required: false
default: "false"
default: 'false'
skip_cue:
description: If true, skips installing CUE CLI if the provider is configured
required: false
default: "false"
default: 'false'
skip_docker:
description: If true, skip authenticating to DockerHub
required: false
default: "false"
default: 'false'
skip_earthly_install:
description: If true, skip installing Earthly
required: false
default: "false"
default: 'false'
skip_earthly_satellite:
description: If true, skip adding authentication for the remote Earthly satellite
required: false
default: "false"
default: 'false'
skip_github:
description: If true, skip authenticating to GitHub Container Registry
required: false
default: "false"
default: 'false'
skip_kcl:
description: If true, skips installing KCL CLI if the provider is configured
required: false
default: "false"
default: 'false'
skip_tailscale:
description: If true, skips installing and authenticating with skip_tailscale
required: false
default: "false"
default: 'false'
skip_timoni:
description: If true, skips installing Timoni CLI if the provider is configured
required: false
default: "false"
default: 'false'

runs:
using: composite
steps:
# AWS Provider
- name: Get AWS provider configuration
id: aws
if: inputs.skip_aws == 'false'
if: ${{ inputs.skip_aws == 'false' }}
#continue-on-error: true
shell: bash
run: |
Expand All @@ -67,22 +67,24 @@ runs:
else
echo "No configuration found for AWS provider"
fi

- name: Login to AWS
uses: aws-actions/configure-aws-credentials@v4
if: steps.aws.outputs.region != '' && steps.aws.outputs.role != '' && steps.aws.conclusion == 'success'
if: ${{ steps.aws.outputs.region != '' && steps.aws.outputs.role != '' && steps.aws.conclusion == 'success' }}
with:
aws-region: ${{ steps.aws.outputs.region }}
role-to-assume: ${{ steps.aws.outputs.role }}

- name: Login to ECR
uses: docker/login-action@v3
if: steps.aws.outputs.registry != 'null' && steps.aws.conclusion == 'success'
if: ${{ steps.aws.outputs.registry != null && steps.aws.conclusion == 'success' }}
with:
registry: ${{ steps.aws.outputs.registry }}

# Docker Provider
- name: Get Docker provider configuration
id: docker
if: inputs.skip_docker == 'false'
if: ${{ inputs.skip_docker == 'false' }}
#continue-on-error: true
shell: bash
run: |
Expand All @@ -108,17 +110,18 @@ runs:
else
echo "No configuration found for DockerHub provider"
fi

- name: Login to Docker Hub
uses: docker/login-action@v3
if: steps.docker.outputs.username != '' && steps.docker.outputs.password != '' && steps.docker.conclusion == 'success'
if: ${{ steps.docker.outputs.username != '' && steps.docker.outputs.password != '' && steps.docker.conclusion == 'success' }}
with:
username: ${{ steps.docker.outputs.username }}
password: ${{ steps.docker.outputs.password }}

# GitHub Provider
- name: Get GitHub provider configuration
id: github
if: inputs.skip_github == 'false'
if: ${{ inputs.skip_github == 'false' }}
shell: bash
run: |
echo "==== GitHub Setup ====="
Expand All @@ -131,17 +134,18 @@ runs:
else
echo "No configuration found for GitHub provider"
fi

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: steps.github.outputs.login && steps.github.conclusion == 'success'
if: ${{ steps.github.outputs.login && steps.github.conclusion == 'success' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.github_token }}

# Earthly Provider
- name: Get Earthly provider configuration
if: inputs.skip_earthly_install == 'false' && inputs.skip_earthly_satellite == 'false'
if: ${{ inputs.skip_earthly_install == 'false' && inputs.skip_earthly_satellite == 'false' }}
id: earthly
shell: bash
run: |
Expand All @@ -167,15 +171,17 @@ runs:

echo "sat=$CONFIG_SAT" >> GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Cache Earthly binary
id: cache-binary
uses: actions/cache@v4
if: inputs.skip_earthly_install == 'false'
if: ${{ inputs.skip_earthly_install == 'false' }}
with:
path: /usr/local/bin/earthly
key: ${{ runner.os }}-${{ steps.earthly.outputs.version }}

- name: Install Earthly
if: inputs.skip_earthly_install == 'false' && steps.cache-binary.outputs.cache-hit == false
if: ${{ inputs.skip_earthly_install == 'false' && steps.cache-binary.outputs.cache-hit == 'false' }}
shell: bash
run: |
if [[ "${{ steps.earthly.outputs.version }}" == "latest" ]]; then
Expand All @@ -186,8 +192,9 @@ runs:

chmod +x /usr/local/bin/earthly
/usr/local/bin/earthly bootstrap

- name: Configure Earthly satellite credentials
if: inputs.skip_earthly_satellite == 'false' && steps.earthly.conclusion == 'success'
if: ${{ inputs.skip_earthly_satellite == 'false' && steps.earthly.conclusion == 'success' }}
shell: bash
run: |
rm -rf "$HOME/.earthly"
Expand All @@ -196,7 +203,7 @@ runs:
# Timoni Provider
- name: Get Timoni provider configuration
id: timoni
if: inputs.skip_timoni == 'false'
if: ${{ inputs.skip_timoni == 'false' }}
shell: bash
run: |
echo "==== Timoni Setup ====="
Expand All @@ -211,16 +218,17 @@ runs:
else
echo "Not installing Timoni CLI"
fi

- name: Install Timoni
uses: stefanprodan/timoni/actions/setup@main
if: steps.timoni.outputs.install && steps.timoni.conclusion == 'success'
if: ${{ steps.timoni.outputs.install && steps.timoni.conclusion == 'success' }}
with:
version: ${{ steps.timoni.outputs.version }}

# CUE Provider
- name: Get CUE provider configuration
id: cue
if: inputs.skip_cue == 'false'
if: ${{ inputs.skip_cue == 'false' }}
shell: bash
run: |
echo "==== CUE Setup ====="
Expand All @@ -235,16 +243,17 @@ runs:
else
echo "Not installing CUE CLI"
fi

- name: Install CUE
uses: cue-lang/[email protected]
if: steps.cue.outputs.install && steps.cue.conclusion == 'success'
if: ${{ steps.cue.outputs.install && steps.cue.conclusion == 'success' }}
with:
version: v${{ steps.cue.outputs.version }}

# KCL Provider
- name: Get KCL provider configuration
id: kcl
if: inputs.skip_kcl == 'false'
if: ${{ inputs.skip_kcl == 'false' }}
shell: bash
run: |
echo "==== KCL Setup ====="
Expand All @@ -259,31 +268,34 @@ runs:
else
echo "Not installing KCL CLI"
fi

- name: Cache KCL
id: cache-kcl
if: steps.kcl.outputs.install && steps.kcl.conclusion == 'success'
if: ${{ steps.kcl.outputs.install && steps.kcl.conclusion == 'success' }}
uses: actions/cache@v4
with:
path: /usr/local/bin/kcl
key: ${{ runner.os }}-kcl-${{ steps.kcl.outputs.version }}

- name: Install KCL
if: steps.kcl.outputs.install && steps.cache-kcl.outputs.cache-hit == false
if: ${{ steps.kcl.outputs.install && steps.cache-kcl.outputs.cache-hit == false }}
shell: bash
run: |
WORKDIR="$(mktemp -d)"
VERSION="${{ steps.kcl.outputs.version }}"
curl -Lo "${WORKDIR}/kcl.tar.gz" https://github.com/kcl-lang/cli/releases/download/$VERSION/kcl-$VERSION-linux-amd64.tar.gz
cd "${WORKDIR}" && tar -xvzf kcl.tar.gz && mv kcl /usr/local/bin/kcl

- name: Check KCL
if: steps.kcl.outputs.install && steps.kcl.conclusion == 'success'
if: ${{ steps.kcl.outputs.install && steps.kcl.conclusion == 'success' }}
shell: bash
run: |
kcl version

# Tailscale Provider
- name: Get Tailscale provider configuration
id: tailscale
if: inputs.skip_tailscale == 'false'
if: ${{ inputs.skip_tailscale == 'false' }}
shell: bash
run: |
echo "==== Tailscale Setup ====="
Expand Down Expand Up @@ -319,8 +331,9 @@ runs:
fi

echo "configured=$CONFIGURED" >> $GITHUB_OUTPUT

- name: Install and configure Tailscale
if: inputs.skip_tailscale == 'false' && steps.tailscale.outputs.configured == 'true'
if: ${{ inputs.skip_tailscale == 'false' && steps.tailscale.outputs.configured == 'true' }}
uses: tailscale/github-action@v3
with:
oauth-client-id: "${{ steps.tailscale.outputs.client-id }}"
Expand Down
Loading