Add support for ingesting VEX documents in the CSAF format #3031
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2022 The GUAC Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: ci | |
on: | |
workflow_dispatch: # testing only, trigger manually to test it works | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
- reopened | |
permissions: | |
contents: read | |
jobs: | |
test-integration: | |
runs-on: ubuntu-latest | |
name: CI for integration tests | |
services: | |
neo4j: | |
image: neo4j:latest # TODO(mihaimaruseac): Pin to hash | |
env: | |
NEO4J_AUTH: none | |
ports: | |
- 7687:7687 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3 | |
- name: setup-go | |
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v3.2.1 | |
with: | |
go-version: '1.19' | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
- name: Setup the project | |
run: go mod download | |
- name: Run integration tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: make integration-test | |
test-unit: | |
runs-on: ubuntu-latest | |
name: CI for unit tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3 | |
- name: setup-go | |
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v3.2.1 | |
with: | |
go-version: '1.19' | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
- name: Setup the project | |
run: go mod download | |
- name: Run tests | |
run: make test | |
static-analysis: | |
name: Static Analysis | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3 | |
- name: setup-go | |
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # tag=v3.2.1 | |
with: | |
go-version: '1.19' | |
- name: Install formatter | |
run: go install golang.org/x/tools/cmd/goimports@latest | |
- name: Check format | |
run: make fmt | |
- name: Check that all generated code is up to date | |
run: make generated_up_to_date | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # tag=v3 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # tag=v3.2.0 | |
with: | |
only-new-issues: true | |
- name: Check markdown format | |
run: make format | |
- name: Check that all linted text is up to date | |
run: make generated_up_to_date | |
end-to-end: | |
name: E2E | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 | |
with: | |
go-version: '~1.19' | |
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 | |
with: | |
python-version: '3.10' | |
- run: ./internal/testing/e2e/e2e |