63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
name: CI on Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test-build-linux:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: rancher/dapper:v0.6.0
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
os: [ linux ]
|
|
arch: [ amd64, arm64 ]
|
|
steps:
|
|
- name: Fix the not-a-git-repository issue
|
|
run: |
|
|
apk -U add git
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "DAPPER_HOST_ARCH=${{ matrix.arch }}" >> "$GITHUB_ENV"
|
|
echo "GH_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"
|
|
echo "GOARCH=${{ matrix.arch }}" >> "$GITHUB_ENV"
|
|
echo "GOOS=${{ matrix.os }}" >> "$GITHUB_ENV"
|
|
echo "CROSS=false" >> "$GITHUB_ENV"
|
|
|
|
- name: build with Dapper
|
|
run: dapper gha-ci
|
|
|
|
test-build-windows:
|
|
strategy:
|
|
matrix:
|
|
os: [ windows ]
|
|
platform: [ windows-2019, windows-latest ]
|
|
arch: [ amd64 ]
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
|
|
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "DAPPER_HOST_ARCH=${{ matrix.arch }}" >> "$GITHUB_ENV"
|
|
echo "GH_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"
|
|
echo "GOARCH=${{ matrix.arch }}" >> "$GITHUB_ENV"
|
|
echo "GOOS=${{ matrix.os }}" >> "$GITHUB_ENV"
|
|
echo "CROSS=false" >> "$GITHUB_ENV"
|
|
|
|
- name: Build and Test
|
|
run: bash ./scripts/gha-ci
|