Go Build #1
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 Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' # Specify the Go version you want to use | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Build | |
run: go build -o dvpl_lz4-linux ./... # Change 'dvpl_lz4-linux' to your desired output name | |
- name: Run tests | |
run: go test ./... # Run your tests | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dvpl_lz4-linux | |
path: dvpl_lz4-linux # Path to your built executable | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' # Specify the Go version you want to use | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Build | |
run: go build -o dvpl_lz4-windows.exe ./... # Change 'dvpl_lz4-windows.exe' to your desired output name | |
- name: Run tests | |
run: go test ./... # Run your tests | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dvpl_lz4-windows | |
path: dvpl_lz4-windows.exe # Path to your built executable |