Merge pull request #5838 from mxpv/ci

Cleanup CI
This commit is contained in:
Fu Wei 2021-08-07 11:33:14 +08:00 committed by GitHub
commit fedd657ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 72 deletions

View File

@ -3,12 +3,10 @@ on:
push:
branches:
- main
- master
- 'release/**'
pull_request:
branches:
- main
- master
- 'release/**'
jobs:
@ -27,19 +25,9 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: golangci/golangci-lint-action@v2
with:
version: v1.36.0
working-directory: src/github.com/containerd/containerd
args: --timeout=5m
#
@ -55,11 +43,6 @@ jobs:
with:
go-version: '1.16.6'
- shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
@ -124,21 +107,9 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.16.6'
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- run: GO111MODULE=on go get github.com/cpuguy83/go-md2man/v2@v2.0.1
- run: go get github.com/cpuguy83/go-md2man/v2@v2.0.1
- run: make man
working-directory: src/github.com/containerd/containerd
# Make sure binaries compile with other platforms
crossbuild:
@ -170,14 +141,7 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.16.6'
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- run: |
set -e -x
@ -211,9 +175,8 @@ jobs:
if [ -n "${packages}" ]; then
sudo apt-get update && sudo apt-get install -y ${packages}
fi
name: install deps
name: Install deps
- name: Build
working-directory: src/github.com/containerd/containerd
env:
GOOS: ${{matrix.goos}}
GOARCH: ${{matrix.goarch}}
@ -360,24 +323,17 @@ jobs:
go-version: '1.16.6'
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- name: Set env
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Install containerd dependencies
env:
RUNC_FLAVOR: ${{ matrix.runc }}
GOFLAGS: -modcacherw
run: |
sudo apt-get install -y gperf
sudo -E PATH=$PATH script/setup/install-seccomp
sudo -E PATH=$PATH script/setup/install-runc
sudo -E PATH=$PATH script/setup/install-cni
sudo -E PATH=$PATH script/setup/install-cni $(grep containernetworking/plugins go.mod | awk '{print $2}')
sudo -E PATH=$PATH script/setup/install-critools
working-directory: src/github.com/containerd/containerd
- name: Install criu
run: |
@ -389,12 +345,10 @@ jobs:
env:
CGO_ENABLED: 1
run: |
make binaries
make binaries GO_BUILD_FLAGS="-mod=vendor"
sudo -E PATH=$PATH make install
working-directory: src/github.com/containerd/containerd
- run: sudo -E PATH=$PATH script/setup/install-gotestsum
working-directory: src/github.com/containerd/containerd
- name: Tests
env:
GOPROXY: direct
@ -402,7 +356,6 @@ jobs:
run: |
make test
sudo -E PATH=$PATH make root-test
working-directory: src/github.com/containerd/containerd
- name: Integration 1
env:
@ -416,7 +369,6 @@ jobs:
extraflags="EXTRA_TESTFLAGS=-no-criu";
}
sudo -E PATH=$PATH make integration ${extraflags} TESTFLAGS_RACE=-race
working-directory: src/github.com/containerd/containerd
# Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759
- name: Integration 2
@ -431,14 +383,12 @@ jobs:
extraflags="EXTRA_TESTFLAGS=-no-criu";
}
sudo -E PATH=$PATH TESTFLAGS_PARALLEL=1 make integration ${extraflags}
working-directory: src/github.com/containerd/containerd
- name: CRI Integration Test
env:
TEST_RUNTIME: ${{ matrix.runtime }}
run: |
CONTAINERD_RUNTIME=$TEST_RUNTIME make cri-integration
working-directory: src/github.com/containerd/containerd
- name: cri-tools critest
env:
@ -490,25 +440,13 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.16.6'
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/containerd
- name: Set env
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- run: sudo -E PATH=$PATH script/setup/install-gotestsum
working-directory: src/github.com/containerd/containerd
- name: Tests
env:
GOPROXY: direct
GOTESTSUM_JUNITFILE: "${{ github.workspace }}/macos-test-junit.xml"
run: |
make test
working-directory: src/github.com/containerd/containerd
run: make test
- uses: actions/upload-artifact@v2
if: always()
with:

View File

@ -252,11 +252,11 @@ genman: man/containerd.8 man/ctr.8
man/containerd.8: FORCE
@echo "$(WHALE) $@"
$(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
$(GO) run -mod=readonly ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
man/ctr.8: FORCE
@echo "$(WHALE) $@"
$(GO) run ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
$(GO) run -mod=readonly ${GO_TAGS} cmd/gen-manpages/main.go $(@F) $(@D)
man/%: docs/man/%.md FORCE
@echo "$(WHALE) $@"

View File

@ -21,7 +21,7 @@
#
set -eu -o pipefail
CNI_COMMIT=$(grep containernetworking/plugins "$GOPATH"/src/github.com/containerd/containerd/go.mod | awk '{print $2}')
CNI_COMMIT=${1:-$(grep containernetworking/plugins "$GOPATH"/src/github.com/containerd/containerd/go.mod | awk '{print $2}')}
CNI_DIR=${DESTDIR:=''}/opt/cni
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d

View File

@ -22,7 +22,7 @@ set -eu -o pipefail
script_dir="$(cd -- "$(dirname -- "$0")" > /dev/null 2>&1; pwd -P)"
cd "$GOPATH"
cd "$(go env GOPATH)"
go get -u github.com/onsi/ginkgo/ginkgo
: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"