fix github actions for setting timezone (#7)
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 90a54fa..cc92624 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -6,8 +6,10 @@
pull_request:
branches: [ main ]
-jobs:
+env:
+ TZ: Asia/Shanghai
+jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
@@ -16,13 +18,6 @@
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- - name: Setup timezone
- uses: szenius/set-timezone@v1.0
- with:
- timezoneLinux: "Asia/Shanghai"
- timezoneMacos: "Asia/Shanghai"
- timezoneWindows: "China Standard Time"
-
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
@@ -34,13 +29,17 @@
- name: Get dependencies
run: |
go get -v -t -d ./...
- # if [ -f Gopkg.toml ]; then
- # curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- # dep ensure
- # fi
- name: Build
run: go build -v ./...
+ - name: Set timezone
+ if : matrix.os == 'windows-latest'
+ run: |
+ tzutil /g
+ tzutil /s "China Standard Time"
+ tzutil /g
+ shell: cmd
+
- name: Test
run: go test -v ./...