|
37 | 37 | - name: Install dependencies |
38 | 38 | run: | |
39 | 39 | apk update |
40 | | - apk add curl findutils git go nodejs upx xz yara-x~1.12.0 |
| 40 | + apk add curl findutils git gnutar go nodejs upx xz yara-x~1.12.0 |
41 | 41 |
|
42 | 42 | - name: Checkout code |
43 | 43 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
47 | 47 | - name: Trust repository |
48 | 48 | run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" |
49 | 49 |
|
| 50 | + - name: Get Go cache paths |
| 51 | + id: go-env |
| 52 | + run: | |
| 53 | + echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" |
| 54 | + echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" |
| 55 | +
|
| 56 | + - name: Cache Go dependencies |
| 57 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 58 | + with: |
| 59 | + path: | |
| 60 | + ${{ steps.go-env.outputs.modcache }} |
| 61 | + ${{ steps.go-env.outputs.cache }} |
| 62 | + key: go-${{ hashFiles('go.sum') }} |
| 63 | + restore-keys: go- |
| 64 | + |
50 | 65 | - name: Unit tests |
51 | 66 | run: | |
52 | 67 | make test |
|
74 | 89 | - name: Install dependencies |
75 | 90 | run: | |
76 | 91 | apk update |
77 | | - apk add curl findutils git go nodejs upx xz yara-x~1.12.0 |
| 92 | + apk add curl findutils git gnutar go nodejs upx xz yara-x~1.12.0 |
78 | 93 |
|
79 | 94 | - name: Checkout code |
80 | 95 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
84 | 99 | - name: Trust repository |
85 | 100 | run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" |
86 | 101 |
|
| 102 | + - name: Get Go cache paths |
| 103 | + id: go-env |
| 104 | + run: | |
| 105 | + echo "modcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" |
| 106 | + echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" |
| 107 | +
|
| 108 | + - name: Cache Go dependencies |
| 109 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 110 | + with: |
| 111 | + path: | |
| 112 | + ${{ steps.go-env.outputs.modcache }} |
| 113 | + ${{ steps.go-env.outputs.cache }} |
| 114 | + key: go-${{ hashFiles('go.sum') }} |
| 115 | + restore-keys: go- |
| 116 | + |
| 117 | + - name: Get samples commit |
| 118 | + id: samples |
| 119 | + run: echo "commit=$(grep '^SAMPLES_COMMIT' Makefile | head -1 | cut -d'=' -f2 | tr -d ' ?')" >> "$GITHUB_OUTPUT" |
| 120 | + |
| 121 | + - name: Cache malcontent samples |
| 122 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 123 | + with: |
| 124 | + path: out/chainguard-sandbox/malcontent-samples |
| 125 | + key: samples-${{ steps.samples.outputs.commit }} |
| 126 | + |
| 127 | + - name: Prepare samples |
| 128 | + run: make samples |
| 129 | + |
87 | 130 | - name: Integration tests |
88 | 131 | run: | |
89 | 132 | make integration |
0 commit comments