Skip to content

Commit

Permalink
feat: adds install action
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Aug 29, 2024
1 parent 59003c7 commit 7a3df51
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test
on:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Forge CLI
uses: ./forge/actions/install
with:
local: "true"
29 changes: 29 additions & 0 deletions forge/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Install Forge CLI
description: Installs the Catalyst Forge CLI on the local runner
inputs:
earthly_version:
description: The version of Earthly to install if not present
default: "latest"
local:
description: If true, the CLI will be installed by building it locally with Earthly (only used for testing)
default: "false"
runs:
using: composite
steps:
- name: Check if earthly is installed
id: check
shell: bash
run: |
if ! command -v earthly &> /dev/null; then
echo "found=false" >> $GITHUB_ENV
else
echo "found=true" >> $GITHUB_ENV
- name: Install Earthly
uses: earthly/actions-setup@v1
if: steps.check.outputs.env.found == 'false'
with:
version: ${{ inputs.earthly_version }}
- name: Build Forge CLI
shell: bash
run: |
earthly --artifact +build/forge /usr/local/bin/forge
Empty file removed forge/actions/setup/action.yml
Empty file.

0 comments on commit 7a3df51

Please sign in to comment.