v/.github/workflows/ci.yaml

62 lines
1.5 KiB
YAML
Raw Normal View History

name: "v CI/CD"
on:
pull_request:
push:
branches:
- main
2024-02-01 04:00:38 +00:00
env:
GO_VERSION: '1.21'
jobs:
2024-02-01 04:53:09 +00:00
test:
name: "Tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-02-01 05:57:30 +00:00
- uses: actions/setup-go@v5
with:
2024-02-01 04:00:38 +00:00
go-version: ${{ env.GO_VERSION }}
- run: . script/test.sh
2024-02-01 04:13:33 +00:00
format:
name: "Formatting check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-02-01 05:57:30 +00:00
- uses: actions/setup-go@v5
2024-02-01 04:13:33 +00:00
with:
go-version: ${{ env.GO_VERSION }}
- run: . script/format.sh
integration-tests:
name: "Integration tests"
runs-on: ubuntu-latest
env:
V_ROOT: /tmp/v
steps:
- uses: actions/checkout@v4
2024-02-01 05:57:30 +00:00
- uses: actions/setup-go@v5
with:
2024-02-01 04:00:38 +00:00
go-version: ${{ env.GO_VERSION }}
- run: . integration/install_specific_version.sh
2024-02-01 04:53:09 +00:00
build:
name: "Build"
runs-on: ubuntu-latest
needs: [test,format,integration-tests]
strategy:
matrix:
dist: ["darwin_amd64", "darwin_arm64", "linux_amd64"]
steps:
- uses: actions/checkout@v4
2024-02-01 05:57:30 +00:00
- uses: actions/setup-go@v5
2024-02-01 04:53:09 +00:00
with:
go-version: ${{ env.GO_VERSION }}
- run: PROD=$PROD GOOS=${DIST%_*} GOARCH=${DIST#*_} . script/build.sh
env:
DIST: ${{ matrix.dist }}
PROD: ${{ github.ref == 'refs/heads/main' && '1' || '' }}
- uses: actions/upload-artifact@v4
with:
name: build-${{matrix.dist}}
path: ./build/**/*