2022-04-17 19:24:34 +03:00
|
|
|
name: Yggdrasil
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
release:
|
2022-04-17 19:53:55 +03:00
|
|
|
workflow_dispatch:
|
2022-04-17 19:24:34 +03:00
|
|
|
|
|
|
|
jobs:
|
2022-04-17 19:53:55 +03:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
|
|
|
args: --issues-exit-code=1
|
|
|
|
|
|
|
|
build-linux:
|
2022-04-17 19:24:34 +03:00
|
|
|
strategy:
|
2022-04-17 19:53:55 +03:00
|
|
|
fail-fast: false
|
2022-04-17 19:24:34 +03:00
|
|
|
matrix:
|
2022-04-17 20:22:26 +03:00
|
|
|
goversion: ["1.17", "1.18"]
|
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
name: Build & Test (Linux, Go ${{ matrix.goversion }})
|
|
|
|
needs: [lint]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
2022-04-17 19:24:34 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-17 20:22:26 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-17 19:24:34 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.goversion }}
|
2022-04-17 19:24:34 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Build Yggdrasil
|
|
|
|
run: go build -v ./...
|
2022-04-17 19:24:34 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Unit tests
|
|
|
|
run: go test -v ./...
|
2022-04-17 19:53:55 +03:00
|
|
|
|
|
|
|
build-windows:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-04-17 20:22:26 +03:00
|
|
|
goversion: ["1.17", "1.18"]
|
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
name: Build & Test (Windows, Go ${{ matrix.goversion }})
|
|
|
|
needs: [lint]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2022-04-17 20:22:26 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.goversion }}
|
|
|
|
|
|
|
|
- name: Build Yggdrasil
|
|
|
|
run: go build -v ./...
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Unit tests
|
|
|
|
run: go test -v ./...
|
2022-04-17 19:53:55 +03:00
|
|
|
|
|
|
|
build-macos:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-04-17 20:22:26 +03:00
|
|
|
goversion: ["1.17", "1.18"]
|
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
name: Build & Test (macOS, Go ${{ matrix.goversion }})
|
|
|
|
needs: [lint]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2022-04-17 20:22:26 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.goversion }}
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Build Yggdrasil
|
|
|
|
run: go build -v ./...
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Unit tests
|
|
|
|
run: go test -v ./...
|
2022-04-17 19:53:55 +03:00
|
|
|
|
|
|
|
tests-ok:
|
|
|
|
name: All tests passed
|
|
|
|
needs: [build-linux, build-windows, build-macos]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ !cancelled() }}
|
|
|
|
steps:
|
|
|
|
- name: Check all tests passed
|
|
|
|
uses: re-actors/alls-green@release/v1
|
|
|
|
with:
|
|
|
|
jobs: ${{ toJSON(needs) }}
|