-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial caching to Github Actions workflow
- Loading branch information
1 parent
f8db3a5
commit b127fa1
Showing
6 changed files
with
113 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Funnel Build and Cache | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-mod- | ||
- name: Cache Funnel binary | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./funnel # Path to the Funnel executable | ||
key: ${{ runner.os }}-funnel-bin-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Build Funnel (only if cache doesn't exist) | ||
run: | | ||
if [ ! -f ./funnel ]; then | ||
make build | ||
fi | ||
- name: Cache Funnel binary (after build) | ||
uses: actions/cache@v3 | ||
with: | ||
path: funnel/ | ||
key: ${{ runner.os }}-funnel-bin-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Upload Funnel binary as artifact (optional) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: funnelBin | ||
path: funnel/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Funnel Use Workflow | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Funnel Build and Cache"] # Name of the build workflow | ||
types: | ||
- completed | ||
|
||
jobs: | ||
use-funnel: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Funnel binary | ||
uses: actions/cache@v3 | ||
with: | ||
path: funnel/ | ||
key: ${{ runner.os }}-funnel-bin-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-funnel-bin- | ||
- name: Use Funnel binary | ||
run: | | ||
if [ -f ./funnel/funnel ]; then | ||
echo "Using cached Funnel binary" | ||
chmod +x ./funnel/funnel | ||
./funnel/funnel server --LocalStorage.AllowedDirs $HOME run & | ||
else | ||
echo "Funnel binary not found. Exiting." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ name: S3 Integration Test | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: Go Tests | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# Temporarily disabling linting | ||
|