@@ -2,6 +2,8 @@ name: "Validations"
22on :
33 workflow_dispatch :
44 push :
5+ branches :
6+ - main
57 pull_request :
68
79env :
4345 - name : Run static analysis
4446 run : make static-analysis
4547
48+ # allow for PRs to skip validating the syft version to allow for incremental updates of syft before release.
49+ # In this way checks against the main branch (which are required for release) will fail, but PR checks will not
50+ - name : Ensure syft version is a release version
51+ run : |
52+ echo "GitHub reference: ${GITHUB_REF##*/}"
53+ git fetch origin main
54+ git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && make validate-syft-release-version || echo "skipping syft version check"
55+
56+
4657 Unit-Test :
4758 # Note: changing this job name requires making the same update in the .github/workflows/release.yaml pipeline
4859 name : " Unit tests"
@@ -174,5 +185,60 @@ jobs:
174185 brew install docker
175186 mkdir ~/.docker
176187
177- - name : Run install.sh tests (Mac)
178- run : make install-test-ci-mac
188+ # TODO: put back in after the first release
189+ # - name: Run install.sh tests (Mac)
190+ # run: make install-test-ci-mac
191+
192+ Cli-Linux :
193+ # Note: changing this job name requires making the same update in the .github/workflows/release.yaml pipeline
194+ name : " CLI tests (Linux)"
195+ needs : [Build-Snapshot-Artifacts]
196+ runs-on : ubuntu-20.04
197+ steps :
198+ - uses : actions/setup-go@v2
199+ with :
200+ go-version : ${{ env.GO_VERSION }}
201+
202+ - uses : actions/checkout@v2
203+ with :
204+ # this downloads and initializes LFS, but does not pull the objects
205+ lfs : true
206+ # we need to jump between multiple branches to compare compute a diff, which means we need a deeper clone depth
207+ fetch-depth : 0
208+
209+ - name : Restore go cache
210+ id : go-cache
211+ uses : actions/cache@v2.1.3
212+ with :
213+ path : ~/go/pkg/mod
214+ key : ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
215+ restore-keys : |
216+ ${{ runner.os }}-go-${{ env.GO_VERSION }}-
217+
218+ - name : Restore tool cache
219+ id : tool-cache
220+ uses : actions/cache@v2.1.3
221+ with :
222+ path : ${{ github.workspace }}/.tmp
223+ key : ${{ runner.os }}-tool-${{ hashFiles('Makefile') }}
224+
225+ - name : (cache-miss) Bootstrap all project dependencies
226+ if : steps.tool-cache.outputs.cache-hit != 'true' || steps.go-cache.outputs.cache-hit != 'true'
227+ run : make bootstrap
228+
229+ - name : Build key for tar cache
230+ run : make cli-fingerprint
231+
232+ - name : Restore CLI test cache
233+ uses : actions/cache@v2.1.3
234+ with :
235+ path : ${{ github.workspace }}/test/cli/test-fixtures/cache
236+ key : ${{ runner.os }}-cli-test-cache-${{ hashFiles('test/cli/test-fixtures/cache.fingerprint') }}
237+
238+ - uses : actions/download-artifact@v2
239+ with :
240+ name : artifacts
241+ path : snapshot
242+
243+ - name : Run CLI Tests (Linux)
244+ run : make cli
0 commit comments