Skip to content

Commit

Permalink
Update dependencies (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
  • Loading branch information
masa213f authored Apr 15, 2022
1 parent cfc143e commit fcf61bd
Show file tree
Hide file tree
Showing 6 changed files with 355 additions and 223 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ defaults:
run:
working-directory: v2
env:
go-version: 1.16
go-version: 1.17
jobs:
test:
name: Small test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go-version }}
- run: make setup
- run: make test-tools
- run: make check-generate
- run: make code-check
- run: make test
timeout-minutes: 20
- run: make test-dcnet
Expand All @@ -30,9 +33,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/setup-gcloud@v0.2.0
- id: auth
uses: google-github-actions/auth@v0.7.0
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v0.6.0
- name: Run e2e test on GCP instance
run: ../bin/run-mtest.sh
- name: Set the instance lifetime
Expand Down
51 changes: 9 additions & 42 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ defaults:
run:
working-directory: v2
env:
go-version: 1.16
go-version: 1.17
jobs:
deb:
name: Build deb package
release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go-version }}
- run: |
Expand All @@ -24,44 +23,12 @@ jobs:
echo "deb_version=$deb_version" >> $GITHUB_ENV
- run: make setup
- run: make deb VERSION=${{ env.version }}
- name: Upload the deb package
uses: actions/upload-artifact@v2
with:
name: deb
path: v2/placemat2_${{ env.deb_version }}_amd64.deb
release:
name: Release on GitHub
needs: deb
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: |
version=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
deb_version=$(echo $version | sed -e "s/v//g")
echo "deb_version=$deb_version" >> $GITHUB_ENV
- name: Download the deb package
uses: actions/download-artifact@v2
with:
name: deb
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
See [CHANGELOG.md](./CHANGELOG.md) for details.
draft: false
prerelease: ${{ contains(github.ref, '-') }}
- name: Upload Release Asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./placemat2_${{ env.deb_version }}_amd64.deb
asset_name: placemat2_${{ env.deb_version }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
run: |
if echo ${{ env.version }} | grep -q -e '-'; then prerelease=-p; fi
gh release create ${{ env.version }} $prerelease \
-t "Release ${{ env.version }}" \
-n "See [CHANGELOG.md](./CHANGELOG.md) for details." \
placemat2_${{ env.deb_version }}_amd64.deb
1 change: 1 addition & 0 deletions v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
50 changes: 22 additions & 28 deletions v2/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
SUDO = sudo
FAKEROOT = fakeroot

TESTTOOLDIR := $(CURDIR)/bin
NILERR := $(TESTTOOLDIR)/nilerr
STATICCHECK := $(TESTTOOLDIR)/staticcheck
CUSTOMCHECKER := $(TESTTOOLDIR)/custom-checker

### for debian package
PACKAGES := fakeroot
WORKDIR := $(CURDIR)/work
Expand Down Expand Up @@ -35,24 +40,34 @@ $(DEB):

.PHONY: clean
clean:
rm -rf $(WORKDIR) $(DEB)
rm -rf $(TESTTOOLDIR) $(WORKDIR) $(DEB)

.PHONY: setup
setup:
$(SUDO) apt-get update
$(SUDO) apt-get -y install --no-install-recommends qemu qemu-kvm cloud-utils freeipmi-tools

.PHONY: test-tools
test-tools:
GOBIN=$(TESTTOOLDIR) go install github.com/cybozu/neco-containers/golang/analyzer/cmd/custom-checker@latest
GOBIN=$(TESTTOOLDIR) go install honnef.co/go/tools/cmd/staticcheck@latest
GOBIN=$(TESTTOOLDIR) go install github.com/gostaticanalysis/nilerr/cmd/nilerr@latest

.PHONY: check-generate
check-generate:
go mod tidy
git diff --exit-code --name-only

.PHONY: code-check
code-check: test-tools
code-check:
test -z "$$(gofmt -s -l . | tee /dev/stderr)"
staticcheck ./...
test -z "$$(nilerr ./... 2>&1 | tee /dev/stderr)"
test -z "$$(custom-checker -restrictpkg.packages=html/template,log $$(go list -tags='$(GOTAGS)' ./...) 2>&1 | tee /dev/stderr)"
go install ./...
$(STATICCHECK) ./...
test -z "$$($(NILERR) ./... 2>&1 | tee /dev/stderr)"
test -z "$$($(CUSTOMCHECKER) -restrictpkg.packages=html/template,log $$(go list -tags='$(GOTAGS)' ./...) 2>&1 | tee /dev/stderr)"
go vet ./...

.PHONY: test
test: code-check
test:
go test -race -v -count 1 ./...

.PHONY: test-dcnet
Expand All @@ -66,24 +81,3 @@ test-vm:
go test -c ./pkg/vm
$(SUDO) ./vm.test -test.v
rm -f vm.test

.PHONY: test-tools
test-tools: custom-checker staticcheck nilerr

.PHONY: custom-checker
custom-checker:
if ! which custom-checker >/dev/null; then \
cd /tmp; env GOFLAGS= GO111MODULE=on go get github.com/cybozu/neco-containers/golang/analyzer/cmd/custom-checker; \
fi

.PHONY: staticcheck
staticcheck:
if ! which staticcheck >/dev/null; then \
cd /tmp; env GOFLAGS= GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck; \
fi

.PHONY: nilerr
nilerr:
if ! which nilerr >/dev/null; then \
cd /tmp; env GOFLAGS= GO111MODULE=on go get github.com/gostaticanalysis/nilerr/cmd/nilerr; \
fi
30 changes: 14 additions & 16 deletions v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ go 1.16
require (
github.com/containernetworking/plugins v0.9.1
github.com/coreos/go-iptables v0.6.0
github.com/cybozu-go/log v1.6.0
github.com/cybozu-go/netutil v1.4.1
github.com/cybozu-go/well v1.10.0
github.com/fatih/color v1.12.0
github.com/gin-gonic/gin v1.7.2
github.com/leodido/go-urn v1.2.1 // indirect
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/spf13/cobra v1.2.1
github.com/stmcginnis/gofish v0.11.0
github.com/ugorji/go v1.2.3 // indirect
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
k8s.io/apimachinery v0.21.3
sigs.k8s.io/yaml v1.2.0
github.com/cybozu-go/log v1.6.1
github.com/cybozu-go/netutil v1.4.2
github.com/cybozu-go/well v1.11.0
github.com/fatih/color v1.13.0
github.com/gin-gonic/gin v1.7.7
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.19.0
github.com/spf13/cobra v1.4.0
github.com/stmcginnis/gofish v0.13.0
github.com/vishvananda/netlink v1.2.0-beta
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
k8s.io/apimachinery v0.23.5
sigs.k8s.io/yaml v1.3.0
)
Loading

0 comments on commit fcf61bd

Please sign in to comment.