From 92ff58428866fb8161681b0ced1d62e226e8825f Mon Sep 17 00:00:00 2001 From: Michael Salaverry Date: Mon, 10 Jun 2024 20:52:50 +0000 Subject: [PATCH] test: add test and build caching fix: nektos/act isn't the same as the runner fix: another try fix: fix: fix: fix: fix: fix: fix: fix: --- .github/workflows/makefile.yml | 43 +++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 5281623..66ad7bd 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -1,4 +1,4 @@ -name: Makefile CI +name: build and test on: push: @@ -14,5 +14,42 @@ jobs: steps: - uses: actions/checkout@v4 - - name: make binary - run: make websocketd + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + # - name: build using makefile + # run: make websocketd + + - name: build websocketd + run: go build + + - name: Archive build artifacts + uses: actions/upload-artifact@v4 + with: + name: websocketd + path: | + websocketd + ./examples/bash/dump-env.sh + + + test: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download built websocketd + uses: actions/download-artifact@v4 + with: + name: websocketd + + - name: fix permissions + run: chmod +x ./websocketd && chmod +x ./examples/bash/dump-env.sh + + - name: setup client + run: wget https://github.com/vi/websocat/releases/latest/download/websocat.x86_64-unknown-linux-musl && chmod +x websocat.x86_64-unknown-linux-musl + + - name: test + run: | + ./websocketd --port=8080 ./examples/bash/dump-env.sh & + ./websocat.x86_64-unknown-linux-musl -E ws://$(hostname):8080