diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cb4d790..843db1c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Forge CLI - uses: ./forge/actions/install - name: Setup - uses: ./forge/actions/setup \ No newline at end of file + uses: ./forge/actions/setup + with: + forge_version: local \ No newline at end of file diff --git a/forge/actions/forge/action.yml b/forge/actions/forge/action.yml deleted file mode 100644 index 92d47ef0..00000000 --- a/forge/actions/forge/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Run Forge CLI -description: Run the Forge CLI -inputs: - command: - description: The command to run - required: true - args: - description: The arguments to pass to the command -outputs: - result: - description: The result of the command - value: "" -runs: - using: composite - steps: - - name: Run - shell: bash - run: | - OUTPUT=$(forge ${{inputs.command}} ${{inputs.args}} | tee ) diff --git a/forge/actions/install/action.yml b/forge/actions/install/action.yml deleted file mode 100644 index 95ffe261..00000000 --- a/forge/actions/install/action.yml +++ /dev/null @@ -1,40 +0,0 @@ -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" -runs: - using: composite - steps: - - name: Check if earthly is installed - continue-on-error: true - id: check - shell: bash - run: | - if ! command -v earthly &> /dev/null; then - echo "found=false" >> $GITHUB_OUTPUT - else - echo "found=true" >> $GITHUB_OUTPUT - fi - - name: Install Earthly - uses: earthly/actions-setup@v1 - if: steps.check.outputs.found == 'false' - with: - version: ${{ inputs.earthly_version }} - - name: Cache Forge CLI binary - id: cache-forge - uses: actions/cache@v3 - with: - path: /usr/local/bin/forge - key: ${{ runner.os }}-forge-${{ hashFiles('forge/cli/**') }} - restore-keys: | - ${{ runner.os }}-forge- - - name: Build Forge CLI - if: steps.cache-forge.outputs.cache-hit != 'true' - shell: bash - run: | - earthly --artifact ./forge/cli+build/forge /usr/local/bin/forge - - name: Check version - shell: bash - run: forge version diff --git a/forge/actions/setup/action.yml b/forge/actions/setup/action.yml index 0deab446..c4ff9247 100644 --- a/forge/actions/setup/action.yml +++ b/forge/actions/setup/action.yml @@ -1,27 +1,34 @@ name: Setup CI description: Sets up the CI with the configured providers inputs: - github_token: - description: Github token used to fetch local actions - required: false - default: ${{ github.token }} + earthly_version: + description: The version of Earthly to install + default: latest + forge_version: + description: The version of the forge CLI to install (use 'local' for testing) + default: latest runs: using: composite steps: - - name: Setup workaround for local actions - uses: actions/checkout@v4 + - name: Install Earthly + uses: earthly/actions-setup@v1 + if: inputs.forge_version == 'local' with: - repository: input-output-hk/catalyst-forge - ref: ${{ github.action_ref }} - token: ${{ inputs.github_token }} - path: .local-action-cache - sparse-checkout: | - forge/actions/blueprint - - name: Dump blueprint - id: blueprint - uses: ./.local-action-cache/forge/actions/blueprint + version: ${{ inputs.earthly_version }} + - name: Cache Forge CLI binary + if: inputs.forge_version == 'local' + id: cache-forge + uses: actions/cache@v3 with: - path: . - - name: Show + path: /usr/local/bin/forge + key: ${{ runner.os }}-forge-${{ hashFiles('forge/cli/**') }} + restore-keys: | + ${{ runner.os }}-forge- + - name: Build Forge CLI + if: steps.cache-forge.outputs.cache-hit != 'true' && inputs.forge_version == 'local' shell: bash - run: echo '${{ steps.blueprint.outputs.json }}' \ No newline at end of file + run: | + earthly --artifact ./forge/cli+build/forge /usr/local/bin/forge + - name: Check version + shell: bash + run: forge version \ No newline at end of file