name: CI on: [push, pull_request] env: GO_VERSION: '~1.21' GO_STABLE: 'true' NODE_VERSION: 18 jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: stable: ${{ env.GO_STABLE }} go-version: ${{ env.GO_VERSION }} - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} - name: Install go dependencies run: | go get -t ./... go install github.com/tkw1536/gogenlicense/cmd/gogenlicense@latest - name: Install node dependencies run: | cd internal/dis/component/server/assets yarn install --frozen-lockfile - name: Run 'go generate ./...' run: | export PATH=$PATH:$(go env GOPATH)/bin go generate ./... - name: Run 'go test ./...' run: | go test ./... - name: Build executable run: | CGO_ENABLED=0 go build -o wdcli ./cmd/wdcli - name: Upload Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | wdcli - name: Upload artifact uses: actions/upload-artifact@v3 with: name: wdcli path: wdcli