From b8b3f82986a5d5f3667560a415f81799b54dd11a Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Thu, 9 Mar 2023 12:41:02 +0100 Subject: [PATCH] Add workflow to autobuild & test --- .github/workflows/test.yaml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..4c4e856 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,50 @@ +name: CI + +on: [push, pull_request] + +env: + GO_VERSION: '~1.20' + 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: | + 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