mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-20 05:27:12 +03:00
6cc41359a9
Co-authored-by: Azeem Shaikh <azeems@google.com>
72 lines
2.4 KiB
YAML
72 lines
2.4 KiB
YAML
# Copyright 2021 Security Scorecard 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: build
|
|
on: [push, pull_request]
|
|
jobs:
|
|
validate:
|
|
name: Validate
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
- name: Cache protobuf library.
|
|
id: cache-protobuf
|
|
uses: actions/cache@d9747005de0f7240e5d35a68dca96b3f41b8b340
|
|
with:
|
|
path: protobuf
|
|
key: ${{ runner.os }}-protobuf
|
|
- name: Build protobuf library.
|
|
if: steps.cache-protobuf.outputs.cache-hit != 'true'
|
|
run: |
|
|
git clone https://github.com/protocolbuffers/protobuf.git
|
|
cd protobuf
|
|
git submodule update --init --recursive
|
|
./autogen.sh
|
|
./autogen.sh # see https://github.com/protocolbuffers/protobuf/issues/149
|
|
./configure
|
|
make
|
|
make check
|
|
- name: Install protobuf library
|
|
run: |
|
|
cd protobuf
|
|
sudo make install
|
|
sudo ldconfig
|
|
- name: Clone the code
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
|
|
with:
|
|
go-version: '^1.16'
|
|
- name: Run presubmit tests
|
|
run: |
|
|
go env -w GOFLAGS=-mod=mod
|
|
make all
|
|
license-check:
|
|
name: license boilerplate check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
|
- uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 # v2.1.3
|
|
with:
|
|
go-version: '1.16'
|
|
- name: Check license headers
|
|
run: |
|
|
go env -w GOFLAGS=-mod=mod
|
|
make all
|
|
set -e
|
|
addlicense -ignore "**/script-empty.sh" -l apache -c 'Security Scorecard Authors' -v *
|
|
git diff --exit-code
|