CI #158
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
name: CI | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
schedule: | |
- cron: '6 0 * * 5' | |
jobs: | |
unit_test: | |
name: Run tests | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- name: Set up toolchain | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
id: go | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Run unit tests | |
run: | | |
go test ./... -v | |
examples: | |
name: Run examples | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up toolchain | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
id: go | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Run example1 | |
run: go run ./examples/example1/main.go | |
- name: Run example2 | |
run: go run ./examples/example2/main.go | |
- name: Run example3 | |
run: go run ./examples/example3/main.go | |
iata: | |
name: Test IATA generation | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up toolchain | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
id: go | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Generate IATA | |
run: time go run ./iata/generate/generate.go | |
- name: Check for changes | |
run: git diff | |
proto: | |
name: Test proto generation | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up toolchain | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
id: go | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Setup protocol buffer compiler | |
run: | | |
sudo apt-get install protobuf-compiler | |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 | |
- name: Generate proto | |
run: go generate ./... | |
- name: Check for changes | |
run: | | |
if [ ! -z "$(git status --porcelain)" ] | |
then | |
git diff | |
exit 1 | |
fi |