mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
5d1b0268dd
1. Use ubuntu-20.04 instead of ubuntu-latest to fix warnings like > Ubuntu-latest workflows will use Ubuntu-20.04 soon. For more details, > see https://github.com/actions/virtual-environments/issues/1816 2. Minor formatting fixes, remove redundant name: etc. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: validate
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
# must be specified without patch version
|
|
version: v1.31
|
|
|
|
# Only show new issues for a pull request.
|
|
only-new-issues: true
|
|
|
|
shfmt:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: vars
|
|
run: |
|
|
echo "VERSION=3.2.0" >> $GITHUB_ENV
|
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
|
- name: cache go mod and $GOCACHE
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: ${{ runner.os }}-shfmt-${{ env.VERSION }}
|
|
restore-keys: ${{ runner.os }}-shfmt-
|
|
- name: install shfmt
|
|
run: |
|
|
command -v shfmt || \
|
|
(cd ~ && GO111MODULE=on time go get mvdan.cc/sh/v3/cmd/shfmt@v$VERSION)
|
|
- name: shfmt
|
|
run: make shfmt
|
|
|
|
shellcheck:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: vars
|
|
run: |
|
|
echo 'VERSION=v0.7.1' >> $GITHUB_ENV
|
|
echo 'BASEURL=https://github.com/koalaman/shellcheck/releases/download' >> $GITHUB_ENV
|
|
echo 'SHA256SUM=1e8499d6f90481bfa2af7a4dce86dd9bcba5c0fbd88bf4793b34ec679c8bb98a' >> $GITHUB_ENV
|
|
echo ~/bin >> $GITHUB_PATH
|
|
- name: install shellcheck
|
|
run: |
|
|
mkdir ~/bin
|
|
curl -sSfL $BASEURL/$VERSION/shellcheck-$VERSION.linux.x86_64.tar.xz |
|
|
tar xfJ - -C ~/bin --strip 1 shellcheck-$VERSION/shellcheck
|
|
sha256sum ~/bin/shellcheck | grep -q $SHA256SUM
|
|
# make sure to remove the old version
|
|
sudo rm -f /usr/bin/shellcheck
|
|
- uses: lumaxis/shellcheck-problem-matchers@v1
|
|
- name: shellcheck
|
|
run: |
|
|
make shellcheck
|
|
|
|
deps:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: cache go mod and $GOCACHE
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: ${{ runner.os }}-go.sum-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: ${{ runner.os }}-go.sum-
|
|
- name: verify deps
|
|
run: make verify-dependencies
|