Skip to content

Commit

Permalink
Simplify CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Aug 23, 2023
1 parent c078d68 commit defd4af
Showing 1 changed file with 11 additions and 35 deletions.
46 changes: 11 additions & 35 deletions .github/workflows/fmt-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,24 @@ on:
branches:
- main

name: Fmt
name: Fmt & Build and Test

jobs:
gofmt:
name: Format
runs-on: ubuntu-latest
build-test:
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18'

- name: Format sources
run: |
test -z $(gofmt -s -l .)
build-examples:
name: Build all examples
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Build all examples
run: |
for example in $(ls v2/examples/*/*.go); do
if ! $(go build $example); then
exit 1
fi
done
test:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Build
run: go build -v ./...

- name: Test
run: |
for t in $(ls v2/tests/*.go); do
if ! $(go test $t); then
exit 1
fi
done
run: go test -v ./...

0 comments on commit defd4af

Please sign in to comment.