diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06601bb1..92872a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/actions/setup/action.yml b/actions/setup/action.yml index 0965bfdb..d5139e99 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -8,39 +8,39 @@ 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 @@ -48,7 +48,7 @@ runs: # 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: | @@ -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: | @@ -108,9 +110,10 @@ 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 }} @@ -118,7 +121,7 @@ runs: # 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 =====" @@ -131,9 +134,10 @@ 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 }} @@ -141,7 +145,7 @@ runs: # 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: | @@ -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 @@ -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" @@ -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 =====" @@ -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 =====" @@ -235,16 +243,17 @@ runs: else echo "Not installing CUE CLI" fi + - name: Install CUE uses: cue-lang/setup-cue@v1.0.0 - 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 =====" @@ -259,23 +268,26 @@ 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 @@ -283,7 +295,7 @@ runs: # 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 =====" @@ -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 }}"