Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve workflow for main branch and PRs #17

Merged
merged 4 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Earthly PR +build

on:
pull_request:

env:
FORCE_COLOR: 1

jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- uses: earthly/actions-setup@v1
with:
use-cache: true
version: v0.8.2

# Setup repo and add caching
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}

- name: Run build
run: earthly --ci -P +build

12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Earthly +build
name: Earthly main branch +build

on:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
- main
Expand All @@ -15,17 +13,19 @@ jobs:
build:
permissions:
packages: write
timeout-minutes: 30
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- uses: earthly/actions-setup@v1
with:
use-cache: true
version: v0.8.0
version: v0.8.2

# Setup repo and add caching
- uses: actions/checkout@v4
with:
ref: main

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -35,4 +35,4 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run build
run: earthly --push --ci -P +all
run: earthly --push --ci -P +build
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Earthly +tag
name: Earthly tag +build

on:
push:
Expand Down
4 changes: 4 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ IMPORT github.com/blue-build/earthly-lib/cargo AS cargo
ARG --global IMAGE=ghcr.io/blue-build/cli

all:
BUILD +build
BUILD +integration-tests --NIGHTLY=true --NIGHTLY=false

build:
BUILD +default
BUILD +nightly

Expand Down
Loading