mirror of
https://github.com/anchore/syft.git
synced 2025-11-21 10:23:18 +01:00
* Create independent build targets for Mac and Linux Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Create targets for macOS signing and notarization Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Create target for Linux packaging Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Update release workflow and leverage new make targets Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add release assets to release draft Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add homebrew formula release follow-up and improve Makefile Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add follow-up workflow for updating version check file Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Get rid of fetch depth 0 for checkout action Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add follow-up workflow for Docker images Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Restore wait-for-checks job Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Replace make functions with shell functions Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Account for envsubst command in bootstrap-ci-linux Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * move homebrew generation into script Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * add release approval step; remove goreleaser; add docker image smoke testing in acceptance step Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * replace homebrew formula template file with heredoc template Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * update release documentation Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
102 lines
3.2 KiB
YAML
102 lines
3.2 KiB
YAML
name: "Static Analysis + Unit + Integration"
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
pull_request:
|
|
jobs:
|
|
Static-Analysis:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.x]
|
|
platform: [ubuntu-latest]
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Restore bootstrap cache
|
|
id: bootstrap-cache
|
|
uses: actions/cache@v2.1.3
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
${{ github.workspace }}/.tmp
|
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}-
|
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
|
|
|
- name: Bootstrap project dependencies
|
|
if: steps.bootstrap-cache.outputs.cache-hit != 'true'
|
|
run: make bootstrap
|
|
|
|
- name: Bootstrap CI dependencies
|
|
run: make bootstrap-ci-linux
|
|
|
|
- name: Run static analysis
|
|
run: make static-analysis
|
|
|
|
Tests:
|
|
strategy:
|
|
matrix:
|
|
# test the lower bounds of support, and the latest available
|
|
go-version: [1.13.x, 1.x]
|
|
platform: [ubuntu-latest]
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Restore bootstrap cache
|
|
id: bootstrap-cache
|
|
uses: actions/cache@v2.1.3
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
${{ github.workspace }}/.tmp
|
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}-
|
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
|
|
|
- name: Bootstrap project dependencies
|
|
if: steps.bootstrap-cache.outputs.cache-hit != 'true'
|
|
run: make bootstrap
|
|
|
|
- name: Bootstrap CI dependencies
|
|
run: make bootstrap-ci-linux
|
|
|
|
- name: Build cache key for java test-fixture blobs (for unit tests)
|
|
run: make java-packages-fingerprint
|
|
|
|
- name: Restore Java test-fixture cache
|
|
id: unit-java-cache
|
|
uses: actions/cache@v2.1.3
|
|
with:
|
|
path: syft/cataloger/java/test-fixtures/java-builds/packages
|
|
key: ${{ runner.os }}-unit-java-cache-${{ hashFiles( 'syft/cataloger/java/test-fixtures/java-builds/packages.fingerprint' ) }}
|
|
|
|
- name: Run unit tests
|
|
run: make unit
|
|
|
|
- name: Validate syft output against the CycloneDX schema
|
|
run: make validate-cyclonedx-schema
|
|
|
|
- name: Build key for tar cache
|
|
run: make integration-fingerprint
|
|
|
|
- name: Restore integration test cache
|
|
uses: actions/cache@v2.1.3
|
|
with:
|
|
path: ${{ github.workspace }}/integration/test-fixtures/cache
|
|
key: ${{ runner.os }}-integration-test-cache-${{ hashFiles('integration/test-fixtures/cache.fingerprint') }}
|
|
|
|
- name: Run integration tests
|
|
run: make integration
|