|
36 | 36 | uses: actions/setup-go@v5 |
37 | 37 | with: |
38 | 38 | go-version: 1.22.x |
39 | | - # NOTE: Manage GitHub Actions cache via https://github.com/fastly/cli/actions/caches |
40 | | - # This is useful if you need to clear the cache when a dependency doesn't update correctly. |
41 | | - # |
42 | | - # REFERENCES: |
43 | | - # https://www.airplane.dev/blog/caching-golang-tests-in-ci |
44 | | - # https://markphelps.me/posts/speed-up-your-go-builds-with-actions-cache/ |
45 | | - # |
46 | | - - id: go-cache-paths |
47 | | - name: Retrieve Go Paths |
48 | | - run: | |
49 | | - echo "gobin=$(go env GOPATH)/bin" >> $GITHUB_OUTPUT # speed up dependency installs |
50 | | - echo "gobuild=$(go env GOCACHE)" >> $GITHUB_OUTPUT # speed up `go test` runs |
51 | | - echo "gomod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT # speed up use of third-party modules |
52 | | - - name: "Fix cache directory perms" |
53 | | - run: chmod -R 0755 ~/go/pkg/mod |
54 | | - - name: Go Bin Cache |
55 | | - id: go-bin-deps |
56 | | - uses: actions/cache@v4 |
57 | | - with: |
58 | | - path: ${{ steps.go-cache-paths.outputs.gobin }} |
59 | | - key: ${{ runner.os }}-lint-go-bin-${{ hashFiles('.github/dependencies.txt') }} |
60 | | - - name: Go Build Cache |
61 | | - uses: actions/cache@v4 |
62 | | - with: |
63 | | - path: ${{ steps.go-cache-paths.outputs.gobuild }} |
64 | | - key: ${{ runner.os }}-lint-go-build-${{ hashFiles('**/go.sum') }} |
65 | | - - name: Go Mod Cache |
66 | | - uses: actions/cache@v4 |
67 | | - with: |
68 | | - path: ${{ steps.go-cache-paths.outputs.gomod }} |
69 | | - key: ${{ runner.os }}-lint-go-mod-${{ hashFiles('**/go.sum') }} |
70 | 39 | - name: "Install dependencies" |
71 | | - if: steps.go-bin-deps.outputs.cache-hit != 'true' |
72 | 40 | run: make dependencies |
73 | 41 | shell: bash |
74 | 42 | - name: "Run go mod tidy" |
@@ -114,23 +82,6 @@ jobs: |
114 | 82 | - uses: acifani/setup-tinygo@v2 |
115 | 83 | with: |
116 | 84 | tinygo-version: ${{ matrix.tinygo-version }} |
117 | | - - name: Retrieve Go Paths |
118 | | - # Needed because we can't execute subshell with a third-party action. |
119 | | - id: go-cache-paths |
120 | | - shell: bash # IMPORTANT: without this Windows OS will not work. |
121 | | - run: | |
122 | | - echo "gobuild=$(go env GOCACHE)" >> $GITHUB_OUTPUT # speed up `go test` runs |
123 | | - echo "gomod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT # speed up use of third-party modules |
124 | | - - name: Go Build Cache |
125 | | - uses: actions/cache@v4 |
126 | | - with: |
127 | | - path: ${{ steps.go-cache-paths.outputs.gobuild }} |
128 | | - key: ${{ runner.os }}-test-go-build-${{ hashFiles('**/go.sum') }} |
129 | | - - name: Go Mod Cache |
130 | | - uses: actions/cache@v4 |
131 | | - with: |
132 | | - path: ${{ steps.go-cache-paths.outputs.gomod }} |
133 | | - key: ${{ runner.os }}-test-go-mod-${{ hashFiles('**/go.sum') }} |
134 | 85 | - name: "Install Rust" |
135 | 86 | uses: dtolnay/rust-toolchain@stable |
136 | 87 | - name: "Add wasm32-wasip1 Rust target" |
|
0 commit comments