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

Actions test cache #3

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,29 @@ jobs:
go_version: [1.20.x]
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
cache: false
go-version: ${{ matrix.go_version }}
cache-dependency-path: './go.sum'

- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Verify go dependency paths
run: |
echo "$(go env GOMODCACHE)";
echo "$(go env GOCACHE)"

- name: Cache Go dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('./go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.go-version }}-
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build

- name: Test
run: go test -v ./...
Expand Down
1 change: 1 addition & 0 deletions trigger_workflows
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
8 changes: 8 additions & 0 deletions tw.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for (($i = 0); $i -lt 10; $i++)
{
New-Item -Name "trigger_workflows" -Value ((Get-Content trigger_workflows) / 1 + 1) -Force;
git add .;
git commit -m "trigger_workflows";
git push origin (git rev-parse --abbrev-ref HEAD);
Start-Sleep -Seconds 60;
}