wisski-cloud-distillery/.github/workflows/test.yaml
2023-03-09 12:43:56 +01:00

50 lines
1.3 KiB
YAML

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