rlaforge c2d4f803a6
Fix arch is undefined, update tests, and allow manual invocation of action (#8)
* [ci]: Add workflow_dispatch event to allow running manually

* [fix]: update jest snapshots to latest version

* [ci]: Add GitHub token when running CI

* [fix]: update test to new format of earthly version command

* [chore]: run earthly +compile

* [fix]: try swapping back to amd64

* [ci]: make all checkout actions use the token

* [revert]: undo change to .gitignore

* [revert]: Remove snapshot tests and use semver comparison instead

* [ci]: patch version regexp

* [chore]: actually use the version string

* [ci]: add GITHUB_TOKEN env variable to prevent rate limiting

* [test]: ensure we are checking for less than as well
2022-09-20 17:00:53 -06:00
2022-04-18 18:30:58 -07:00
2022-04-18 18:30:58 -07:00
2022-04-20 18:32:57 -07:00
2022-03-27 20:03:31 -07:00
2022-04-20 18:32:57 -07:00
2022-04-20 18:32:57 -07:00
2022-04-21 15:07:08 -07:00
2022-03-27 19:48:50 -07:00

Setup Earthly - GitHub Action

This repository contains an action for use with GitHub Actions, which installs earthly with a semver-compatible version.

The package is installed into /home/runner/.earthly (or equivalent on Windows) and the bin subdirectory is added to the PATH.

Usage

Full example:

name: GitHub Actions CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  tests:
    name: example earthly test
    runs-on: ubuntu-latest
    steps:
      - uses: earthly/actions-setup@v1
        with:
          version: "latest" # or pin to an specific version, e.g. "v0.6.10"
      - uses: actions/checkout@v2
      - name: Docker login # to avoid dockerhub rate-limiting
        run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
      - name: what version is installed?
        run: earthly --version
      - name: run the earthly hello world
        run: earthly github.com/earthly/hello-world:main+hello

Install the latest version of earthly:

- name: Install earthly
  uses: earthly/setup-earthly@v1

Install a specific version of earthly:

- name: Install earthly
  uses: earthly/setup-earthly@v1
  with:
    version: 0.6.1

Install a version that adheres to a semver range

- name: Install earthly
  uses: earthly/setup-earthly@v1
  with:
    version: ^0.6.0

Testing

You can perform a local test by running earthly +all.

It is also possible to use act to test the contents of the github actions config.

Configuration

The action can be configured with the following arguments:

  • version - The version of earthly to install. Default is latest. Accepts semver style values.
  • github-token (optional) - Token used to query earthly versions.
Description
No description provided
Readme
Languages
TypeScript 69.6%
Earthly 30.4%