Merge pull request #58 from linuxkit/go-124 #37
This file contains hidden or 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: RTF CI | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go 1.23 | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.23.4 | |
| id: go | |
| - name: Set path | |
| run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| env: | |
| GOPATH: ${{runner.workspace}} | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Get pre-requisites | |
| run: | | |
| make install-deps | |
| env: | |
| GOPATH: ${{runner.workspace}} | |
| - name: Tests | |
| run: | | |
| make test | |
| env: | |
| GOPATH: ${{runner.workspace}} | |
| build: | |
| name: Build | |
| needs: test | |
| strategy: | |
| matrix: | |
| os: [linux,darwin,windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go 1.23 | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.23.4 | |
| id: go | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: build | |
| id: build | |
| run: | | |
| if grep -q "windows" <<< "${{matrix.os}}"; then | |
| export TARGET="windows.exe" | |
| else | |
| export TARGET="${{matrix.os}}" | |
| fi | |
| echo "::set-output name=binary::rtf-$TARGET" | |
| make clean | |
| GOOS=${{matrix.os}} make | |
| mv rtf "rtf-${TARGET}" | |
| env: | |
| GOPATH: ${{runner.workspace}} | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{steps.build.outputs.binary}} | |
| path: ${{steps.build.outputs.binary}} | |
| overwrite: true | |