-
Carlos Tadeu Panato Junior authored
Signed-off-by:
Carlos Panato <ctadeu@gmail.com>
Carlos Tadeu Panato Junior authoredSigned-off-by:
Carlos Panato <ctadeu@gmail.com>
main.yml 2.69 KiB
#
# Copyright 2021 The Sigstore 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:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Extract version of Go to use
run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | sed -r 's/^.*://g'| uniq)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVERSION }}
- name: download go-swagger
run : go install github.com/go-swagger/go-swagger/cmd/swagger@v0.27.0
- name: Validate OpenAPI with Swagger
run: swagger validate openapi.yaml
- name: Build
run: make -C $GITHUB_WORKSPACE all
- name: Test
run: go test -v ./...
- name: Ensure no files were modified as a result of the build
run: git update-index --refresh && git diff-index --quiet HEAD -- || git diff --exit-code
container-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Extract version of Go to use
run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | sed -r 's/^.*://g'| uniq)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVERSION }}
- uses: imjasonh/setup-ko@v0.4
with:
version: v0.8.3
- name: container
run: |
KO_DOCKER_REPO=ko.local make ko 2>&1 | tee output.txt
docker run --rm $(tail -1 output.txt) version
e2e:
runs-on: ubuntu-20.04
needs: build
steps:
- name: download minisign
run: sudo add-apt-repository ppa:dysfunctionalprogramming/minisign && sudo apt-get update && sudo apt-get install minisign
- uses: actions/checkout@v2.3.4