Skip to content

Commit

Permalink
setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ciffelia committed Oct 2, 2023
1 parent 2156280 commit 7595bc6
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

env:
earthly_version: ^0.7.19

jobs:
go-mod:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- run: go mod tidy

- name: Check go.mod and go.sum
run: git diff --exit-code -- go.mod go.sum

go-generate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.earthly_version }}

- run: earthly +generate

- name: Check diff
run: git diff --exit-code

go-build:
runs-on: ubuntu-22.04
strategy:
matrix:
go-env:
- name: amd64
env: GOOS=linux GOARCH=amd64
- name: arm64
env: GOOS=linux GOARCH=arm64
- name: armv7
env: GOOS=linux GOARCH=arm GOARM=7
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Build
run: CGO_ENABLED=0 ${{ matrix.go-env.env }} go build -o out/

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.go-env.name }}
path: out/**/*

0 comments on commit 7595bc6

Please sign in to comment.