Upgrade dependencies and tests #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: './go.mod' | |
- name: Requirements | |
run: sudo apt-get install upx-ucl | |
- name: Build | |
run: ./build.sh | |
- name: Upload a Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build_artifacts | |
path: | | |
ws | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: './go.mod' | |
- name: Test ws | |
run: go test -v -coverprofile cover.out . | |
- name: Format ws coverage | |
run: go tool cover -html=cover.out -o coverage.html | |
- name: Test server | |
run: go test -v -coverprofile cover_server.out ./server | |
- name: Format ws coverage | |
run: go tool cover -html=cover_server.out -o coverage_server.html | |
- name: Test ws | |
run: go test -v -coverprofile cover_echo-server.out ./echo-server | |
- name: Format ws coverage | |
run: go tool cover -html=cover_echo-server.out -o coverage_echo-server.html | |
- name: Upload coverage to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_artifacts | |
path: | | |
coverage.html | |
coverage_server.html | |
coverage_echo-server.html | |
push: | |
needs: [build, test] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: build_artifacts | |
- name: Draft new release and upload assets | |
env: | |
GH_TOKEN: ${{ secrets.ACTION_TOKEN }} | |
run: | | |
gh release create "$(git branch --show-current)-$(git rev-parse --short HEAD)" ./ws |