|
1 | | -# This is a basic workflow to help you get started with Actions |
| 1 | +# |
| 2 | +# Copyright 2021 The Sigstore Authors. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
2 | 15 |
|
3 | 16 | name: CI |
4 | 17 |
|
5 | | -# Controls when the action will run. Triggers the workflow on push or pull request |
6 | | -# events but only for the main branch |
7 | 18 | on: |
8 | 19 | push: |
9 | 20 | branches: [ main ] |
10 | 21 | pull_request: |
11 | 22 | branches: [ main ] |
12 | 23 |
|
13 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
14 | 24 | jobs: |
15 | 25 | build: |
16 | | - # The type of runner that the job will run on |
17 | 26 | runs-on: ubuntu-20.04 |
18 | 27 |
|
19 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
20 | 28 | steps: |
21 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
22 | 29 | - uses: actions/checkout@v2 |
23 | | - # Extract version of Go to use |
24 | 30 | - name: Extract version of Go to use |
25 | 31 | run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | sed -r 's/^.*://g'| uniq)" >> $GITHUB_ENV |
26 | | - # Setup Go |
27 | 32 | - uses: actions/setup-go@v2 |
28 | 33 | with: |
29 | 34 | go-version: ${{ env.GOVERSION }} |
30 | | - # Download go-swagger |
31 | 35 | - name: download go-swagger |
32 | 36 | run : go install github.com/go-swagger/go-swagger/cmd/swagger@v0.27.0 |
33 | 37 | - name: Validate OpenAPI with Swagger |
34 | 38 | run: swagger validate openapi.yaml |
35 | | - # Make it |
36 | 39 | - name: Build |
37 | 40 | run: make -C $GITHUB_WORKSPACE all |
38 | | - # Lint it |
39 | | - - name: golangci-lint |
40 | | - uses: golangci/golangci-lint-action@v2.5.2 |
41 | | - with: |
42 | | - version: v1.37.1 |
43 | | - # Test It |
44 | 41 | - name: Test |
45 | 42 | run: go test -v ./... |
46 | | - # Gosec It |
47 | | - - name: Run Gosec Security Scanner |
48 | | - uses: securego/gosec@v2.7.0 |
49 | | - env: |
50 | | - GOROOT: "" |
51 | | - with: |
52 | | - args: ./... |
53 | 43 | - name: Ensure no files were modified as a result of the build |
54 | 44 | run: git update-index --refresh && git diff-index --quiet HEAD -- || git diff --exit-code |
| 45 | + |
55 | 46 | e2e: |
56 | | - # The type of runner that the job will run on |
57 | | - runs-on: ubuntu-20.04 |
| 47 | + runs-on: ubuntu-20.04 |
58 | 48 | needs: build |
59 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
| 49 | + |
60 | 50 | steps: |
61 | 51 | - name: download minisign |
62 | 52 | run: sudo add-apt-repository ppa:dysfunctionalprogramming/minisign && sudo apt-get update && sudo apt-get install minisign |
63 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
64 | 53 | - uses: actions/checkout@v2 |
65 | 54 | - name: Docker Build |
66 | 55 | run: docker-compose build |
|
0 commit comments