Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit 6d24a26

Browse files
authored
*: Migrate to go storage v3 (#1)
* *: Migrate to go storage v3 Signed-off-by: Xuanwo <[email protected]> * Bump to golang 1.15 Signed-off-by: Xuanwo <[email protected]> * Remove indirect modules Signed-off-by: Xuanwo <[email protected]>
1 parent 1d13b8e commit 6d24a26

File tree

14 files changed

+708
-1090
lines changed

14 files changed

+708
-1090
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
name: "CodeQL"
7+
8+
on:
9+
push:
10+
branches: [master]
11+
pull_request:
12+
# The branches below must be a subset of the branches above
13+
branches: [master]
14+
schedule:
15+
- cron: '0 13 * * 5'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
# Override automatic language detection by changing the below list
26+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27+
language: ['go']
28+
# Learn more...
29+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2
34+
with:
35+
# We must fetch at least the immediate parents so that if this is
36+
# a pull request then we can checkout the head.
37+
fetch-depth: 2
38+
39+
# If this run was triggered by a pull request event, then checkout
40+
# the head of the pull request instead of the merge commit.
41+
- run: git checkout HEAD^2
42+
if: ${{ github.event_name == 'pull_request' }}
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

.github/workflows/unit-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Unit Test"
2+
3+
on: [push,pull_request]
4+
5+
jobs:
6+
unit_test:
7+
name: Unit Test
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
go: [ "1.15", "1.16" ]
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
15+
steps:
16+
- name: Set up Go 1.x
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: ${{ matrix.go }}
20+
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
24+
- name: Build
25+
run: make build
26+
27+
- name: Test
28+
run: make test

Makefile

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
SHELL := /bin/bash
22

3+
-include Makefile.env
4+
35
.PHONY: all check format vet lint build test generate tidy
46

57
help:
@@ -9,51 +11,34 @@ help:
911
@echo " generate to generate code"
1012
@echo " test to run test"
1113

12-
# golint: go get -u golang.org/x/lint/golint
13-
# definitions: go get -u github.com/aos-dev/go-storage/cmd/definitions
14-
tools := golint definitions
15-
16-
$(tools):
17-
@command -v $@ >/dev/null 2>&1 || echo "$@ is not found, please install it."
18-
19-
check: vet lint
14+
check: vet
2015

2116
format:
22-
@echo "go fmt"
23-
@go fmt ./...
24-
@echo "ok"
17+
go fmt ./...
2518

2619
vet:
27-
@echo "go vet"
28-
@go vet ./...
29-
@echo "ok"
20+
go vet ./...
3021

31-
lint: golint
32-
@echo "golint"
33-
@golint ./...
34-
@echo "ok"
35-
36-
generate: definitions
22+
generate:
3723
@echo "generate code"
38-
@go generate ./...
39-
@go fmt ./...
40-
@echo "ok"
24+
go generate ./...
25+
go fmt ./...
4126

4227
build: generate tidy check
43-
@echo "build storage"
44-
@go build ./...
45-
@echo "ok"
28+
go build ./...
4629

4730
test:
48-
@echo "run test"
49-
@go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
50-
@go tool cover -html="coverage.txt" -o "coverage.html"
51-
@echo "ok"
31+
go test -race -coverprofile=coverage.txt -covermode=atomic -v .
32+
go tool cover -html="coverage.txt" -o "coverage.html"
33+
34+
integration_test:
35+
go clean -testcache ./tests
36+
go test -tags integration_test -race -covermode=atomic -v ./tests
5237

5338
tidy:
54-
@go mod tidy && go mod verify
39+
go mod tidy
40+
go mod verify
5541

5642
clean:
5743
@echo "clean generated files"
58-
@find . -type f -name 'generated.go' -delete
59-
@echo "Done"
44+
find . -type f -name 'generated.go' -delete

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Package azblob provided support for Azure Storage containers and blobs objects (
33
*/
44
package azblob
55

6-
//go:generate definitions service.hcl
6+
//go:generate go run -tags tools github.com/aos-dev/go-storage/v3/cmd/definitions service.toml

0 commit comments

Comments
 (0)