Skip to content

Commit

Permalink
Another attempt to earthly +build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaykul committed Nov 1, 2023
1 parent af53d71 commit bb40b53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
build:
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
Expand All @@ -29,10 +27,10 @@ jobs:
branch="${GITHUB_REF##*/}"
fi
git checkout -b "$branch" || true
- name: Earthly version
run: earthly --version
- name: Run build
- name: earthly +build
run: earthly +build

- name: Upload Build Output
uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions Build.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ param(
}
)
$InformationPreference = "Continue"
$ErrorView = 'DetailedView'

# The name of the module to publish
$script:PSModuleName = "TerminalBlocks"
Expand Down
8 changes: 4 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ deps:
# So the dependency cach only re-builds when you add a new dependency
COPY RequiredModules.psd1 .
COPY *.csproj .
RUN ["pwsh", "--file", "/Tasks/_Bootstrap.ps1", "-RequiredModulesPath", "RequiredModules.psd1", "-Verbose"]
RUN ["pwsh", "--file", "/Tasks/_Bootstrap.ps1", "-RequiredModulesPath", "RequiredModules.psd1"]
# Install-RequiredModule does not support pre-release modules
RUN ["pwsh", "--command", "Update-Module", "ModuleBuilder", "-AllowPreRelease", "-Verbose"]
RUN ["pwsh", "--command", "Update-Module", "ModuleBuilder", "-AllowPreRelease"]

build:
FROM +deps
RUN mkdir $OUTPUT_ROOT $TEST_ROOT $TEMP_ROOT
COPY . .
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Build", "-File", "Build.build.ps1", "-Verbose"]
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Build", "-File", "Build.build.ps1"]

# SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] <src> [<artifact-dest-path>] [AS LOCAL <local-path>]
SAVE ARTIFACT $OUTPUT_ROOT/$MODULE_NAME AS LOCAL ./output/$MODULE_NAME
Expand All @@ -43,7 +43,7 @@ test:
FROM +build
COPY . .
# make sure you have bin and obj in .earthlyignore, as their content from context might cause problems
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Test", "-File", "Build.build.ps1", "-Verbose"]
RUN ["pwsh", "--command", "Invoke-Build", "-Task", "Test", "-File", "Build.build.ps1"]

# SAVE ARTIFACT [--keep-ts] [--keep-own] [--if-exists] [--force] <src> [<artifact-dest-path>] [AS LOCAL <local-path>]
SAVE ARTIFACT $TEST_ROOT AS LOCAL ./output/tests
Expand Down

0 comments on commit bb40b53

Please sign in to comment.