|
39 | 39 | fail-on-error: true |
40 | 40 | pyflakes: false |
41 | 41 |
|
42 | | - test: |
| 42 | + build-and-test: |
43 | 43 | runs-on: ubuntu-latest |
44 | 44 | steps: |
45 | 45 | - name: Checkout |
|
56 | 56 | with: |
57 | 57 | version: 3.x |
58 | 58 |
|
| 59 | + - name: Create bin directory |
| 60 | + run: mkdir -p "$HOME/bin" |
| 61 | + |
| 62 | + - name: Build |
| 63 | + run: task build |
| 64 | + |
59 | 65 | - name: Run tests |
60 | 66 | run: | |
61 | 67 | task test |
|
79 | 85 | - name: Check licenses |
80 | 86 | run: go-licenses check . --allowed_licenses=Apache-2.0,MIT,BSD-3-Clause,BSD-2-Clause --ignore modernc.org/mathutil |
81 | 87 |
|
82 | | - build: |
83 | | - needs: [lint, test, license-check] |
84 | | - runs-on: ubuntu-latest |
85 | | - steps: |
86 | | - - name: Checkout |
87 | | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
88 | | - |
89 | | - - name: Set up Go |
90 | | - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 |
91 | | - with: |
92 | | - go-version: "1.26.0" |
93 | | - cache: true |
94 | | - |
95 | | - - name: Install Task |
96 | | - uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0 |
97 | | - with: |
98 | | - version: 3.x |
99 | | - |
100 | | - - name: Create bin directory |
101 | | - run: mkdir -p "$HOME/bin" |
102 | | - |
103 | | - - name: Build |
104 | | - run: task build |
105 | | - |
106 | 88 | build-image: |
107 | | - needs: [lint, test, license-check] |
| 89 | + needs: [lint, build-and-test, license-check] |
108 | 90 | runs-on: ubuntu-latest |
109 | 91 | steps: |
110 | 92 | - name: Checkout |
@@ -142,5 +124,7 @@ jobs: |
142 | 124 | tags: ${{ steps.meta.outputs.tags }} |
143 | 125 | labels: ${{ steps.meta.outputs.labels }} |
144 | 126 | build-args: | |
145 | | - GIT_TAG=${{ github.ref_name }} |
146 | | - GIT_COMMIT=${{ github.sha }} |
| 127 | + GIT_TAG=${{ github.event_name == 'pull_request' && 'pr' || github.ref_name }} |
| 128 | + GIT_COMMIT=${{ github.event_name == 'pull_request' && 'dev' || github.sha }} |
| 129 | + cache-from: type=gha,scope=buildx |
| 130 | + cache-to: type=gha,mode=max,scope=buildx |
0 commit comments