run 1 #159
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
name: Investigate Cahing | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
builtin-cache-create: | |
strategy: | |
matrix: | |
repo: [ulule/loukoum, allegro/marathon-consul, rancher/kontainer-engine, decred/dcrstakepool] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.repo }} | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.x" | |
cache: true | |
- name: get | |
run: | | |
go get | |
- name: build | |
run: | | |
go build | |
- name: stats | |
run: | | |
echo 'Build results size(Mb):' | |
du -m -s `go env GOCACHE` | |
echo 'Dependency results size(Mb):' | |
du -m -s `go env MODGOCACHE` | |
echo 'Lines is go.mod:' | |
wc -l go.mod | |
echo 'Lines is go.sum:' | |
wc -l go.sum | |
builtin-cache-use: | |
needs: builtin-cache-create | |
strategy: | |
matrix: | |
repo: [ulule/loukoum, allegro/marathon-consul, rancher/kontainer-engine, decred/dcrstakepool] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.repo }} | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.x" | |
cache: true | |
- name: get | |
run: | | |
go get | |
- name: touch | |
run: | | |
find . -name '*.go' | while read f;do echo "// $(date)" >> $f;N=$((N + 1));if [[ $N -gt 1 ]];then break;fi done | |
- name: build | |
run: | | |
go build | |
action-cache-create: | |
strategy: | |
matrix: | |
repo: [ulule/loukoum, allegro/marathon-consul, rancher/kontainer-engine, decred/dcrstakepool] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.repo }} | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.x" | |
cache: false | |
- name: Get Go cached paths | |
run: | | |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
repo=$(echo '${{ matrix.repo }}'|sed 's/\//-/') | |
echo "repo=${repo}" >> $GITHUB_ENV | |
- name: Create dependencies cache | |
uses: actions/cache@v3 | |
if: ${{ false }} | |
with: | |
path: | | |
${{ env.modcache }} | |
key: action-cache-deps--${{ env.repo }}--${{ hashFiles('go.sum go.mod') }} | |
- name: Create intermediate built files cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.cache }} | |
key: action-cache-build--${{ env.repo }}--${{ hashFiles('**/*.go') }} | |
- name: get | |
run: | | |
go get | |
- name: build | |
run: | | |
go build | |
- name: stats | |
run: | | |
echo 'Build results size(Mb):' | |
du -m -s `go env GOCACHE` | |
echo 'Dependency results size(Mb):' | |
du -m -s `go env MODGOCACHE` | |
echo 'Lines is go.mod:' | |
wc -l go.mod | |
echo 'Lines is go.sum:' | |
wc -l go.sum | |
action-cache-use: | |
needs: action-cache-create | |
strategy: | |
matrix: | |
repo: [ulule/loukoum, allegro/marathon-consul, rancher/kontainer-engine, decred/dcrstakepool] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.repo }} | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.x" | |
cache: false | |
- name: Get Go cached paths | |
run: | | |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
repo=$(echo '${{ matrix.repo }}'|sed 's/\//-/') | |
echo "repo=${repo}" >> $GITHUB_ENV | |
- name: Create dependencies cache | |
uses: actions/cache@v3 | |
if: ${{ false }} | |
with: | |
path: | | |
${{ env.modcache }} | |
key: action-cache-deps--${{ env.repo }}--${{ hashFiles('go.sum go.mod') }} | |
- name: Create intermediate built files cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.cache }} | |
key: action-cache-build--${{ env.repo }}--${{ hashFiles('**/*.go') }} | |
- name: get | |
run: | | |
go get | |
- name: touch | |
run: | | |
find . -name '*.go' | while read f;do echo "// $(date)" >> $f;N=$((N + 1));if [[ $N -gt 1 ]];then break;fi done | |
- name: build | |
run: | | |
go build |