github.com/RevenueMonster/sqlike@v1.0.6/.github/workflows/go.yml (about) 1 name: build 2 on: 3 push: 4 branches: 5 - main 6 pull_request: 7 branches: 8 - main 9 10 jobs: 11 build: 12 name: Build 13 runs-on: ubuntu-latest 14 steps: 15 - name: Shutdown Ubuntu MySQL (SUDO) 16 run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it 17 18 - uses: mirromutth/mysql-action@v1.1 19 with: 20 # host port: 3800 # Optional, default value is 3306. The port of host 21 # container port: 3307 # Optional, default value is 3306. The port of container 22 character set server: "utf8mb4" # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld 23 collation server: "utf8mb4_unicode_ci" # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld 24 mysql version: "8.0" # Optional, default value is "latest". The version of the MySQL 25 mysql database: "sqlike" # Optional, default value is "test". The specified database which will be create 26 mysql root password: "abcd1234" # Required if "mysql user" is empty, default is empty. The root superuser password 27 # mysql user: "developer" # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too 28 # mysql password: "" # Required if "mysql user" exists. The password for the "mysql user" 29 30 - name: Check out code into the Go module directory 31 uses: actions/checkout@v2 32 33 - name: Set up Go 1.15 34 uses: actions/setup-go@v2 35 with: 36 go-version: 1.15 37 38 - name: Get dependencies 39 run: | 40 go get -v -t -d ./... 41 if [ -f Gopkg.toml ]; then 42 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh 43 dep ensure 44 fi 45 46 - name: Test 47 run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... 48 49 - name: Codecov 50 uses: codecov/codecov-action@v2.0.3 51 with: 52 token: ${{secrets.CODECOV_TOKEN}} 53 54 # - name: Golint 55 # run: | 56 # curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2 57 # go get -u golang.org/x/lint/golint 58 # golangci-lint run 59 # golint -set_exit_status