Skip to content

Commit

Permalink
ci: add Earthfile target for CI and update GitHub workflow
Browse files Browse the repository at this point in the history
- Add `ci` target to Earthfile for local builds and tests
- Rename workflow job `Dirty` to `Earthly`
- Replace `+pre-commit` with `+ci` in GitHub workflow
- Remove separate `Tests` job in GitHub workflow
- Update job dependencies in GitHub workflow
  • Loading branch information
flemzord committed Sep 27, 2024
1 parent aca657c commit 4590775
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
30 changes: 3 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dirty:
Earthly:
runs-on: "ubuntu-latest"
steps:
- uses: 'actions/checkout@v4'
Expand All @@ -39,7 +39,7 @@ jobs:
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+pre-commit
+ci
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
- name: Get changed files
Expand All @@ -53,33 +53,9 @@ jobs:
exit 1
fi
Tests:
runs-on: "ubuntu-latest"
needs:
- Dirty
steps:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
with:
token: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+tests
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
GoReleaser:
runs-on: "ubuntu-latest"
if: contains(github.event.pull_request.labels.*.name, 'build-images') || github.ref == 'refs/heads/main' || github.event_name == 'merge_group'
needs:
- Dirty
steps:
- uses: earthly/actions-setup@v1
with:
Expand Down Expand Up @@ -120,7 +96,7 @@ jobs:
environment: staging
needs:
- GoReleaser
- Tests
- Earthly
steps:
- uses: earthly/actions-setup@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,7 @@ export-database-schema:
END
SAVE ARTIFACT docs/database AS LOCAL docs/database

ci:
LOCALLY
BUILD +pre-commit
BUILD +tests

0 comments on commit 4590775

Please sign in to comment.