Add explicity targets to improve auto-completion in Makefile #211
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y libasound2-dev | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- name: Lint | |
run: | | |
make lint | |
- name: Test | |
run: go test -race -v ./... | |
env: | |
CI: 1 | |
- name: Build | |
run: go generate | |
- name: Build with CGO_ENABLED=0 | |
run: CGO_ENABLED=0 go generate | |
- name: Cross-platform build | |
run: | | |
make bin/twenty-twenty-twenty-windows-amd64 | |
make bin/twenty-twenty-twenty-windows-arm64 | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- name: Test | |
run: go test | |
env: | |
CI: 1 | |
- name: Build | |
run: go generate | |
build-macos-nix: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build | |
run: nix build | |
build-linux-nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Check Flake | |
run: nix flake check | |
- name: Build | |
run: | | |
nix build | |
# non-flake build | |
nix-build |