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
|
|
|
|
2022-04-18 12:30:40 +03:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
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:
|
2024-05-28 00:03:41 +03:00
|
|
|
- uses: actions/setup-go@v5
|
2022-04-17 19:53:55 +03:00
|
|
|
with:
|
2023-08-12 20:12:58 +03:00
|
|
|
go-version: 1.21
|
2024-05-28 00:14:28 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-17 19:53:55 +03:00
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
|
|
|
args: --issues-exit-code=1
|
|
|
|
|
2022-04-18 12:33:33 +03:00
|
|
|
codeql:
|
|
|
|
name: Analyse
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-05-28 00:14:28 +03:00
|
|
|
uses: actions/checkout@v4
|
2022-04-18 12:33:33 +03:00
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
|
|
|
uses: github/codeql-action/init@v2
|
|
|
|
with:
|
2022-04-18 12:35:05 +03:00
|
|
|
languages: go
|
2022-04-18 12:33:33 +03:00
|
|
|
|
|
|
|
- name: Autobuild
|
|
|
|
uses: github/codeql-action/autobuild@v2
|
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
|
|
|
uses: github/codeql-action/analyze@v2
|
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
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:
|
2024-05-28 00:03:41 +03:00
|
|
|
goversion: ["1.21", "1.22"]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
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:
|
2024-05-28 00:14:28 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-17 19:24:34 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
2024-05-28 00:03:41 +03:00
|
|
|
uses: actions/setup-go@v5
|
2022-04-17 20:22:26 +03:00
|
|
|
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:
|
2024-05-28 00:03:41 +03:00
|
|
|
goversion: ["1.21", "1.22"]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
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:
|
2024-05-28 00:14:28 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
2024-05-28 00:03:41 +03:00
|
|
|
uses: actions/setup-go@v5
|
2022-04-17 20:22:26 +03:00
|
|
|
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:
|
2024-05-28 00:03:41 +03:00
|
|
|
goversion: ["1.21", "1.22"]
|
2022-04-17 20:22:26 +03:00
|
|
|
|
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:
|
2024-05-28 00:14:28 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-17 19:53:55 +03:00
|
|
|
|
2022-04-17 20:22:26 +03:00
|
|
|
- name: Set up Go
|
2024-05-28 00:03:41 +03:00
|
|
|
uses: actions/setup-go@v5
|
2022-04-17 20:22:26 +03:00
|
|
|
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
|
|
|
|
2023-10-28 01:15:34 +03:00
|
|
|
build-freebsd:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-05-28 00:03:41 +03:00
|
|
|
goversion: ["1.21", "1.22"]
|
2023-10-28 01:15:34 +03:00
|
|
|
goos:
|
|
|
|
- freebsd
|
|
|
|
- openbsd
|
|
|
|
|
|
|
|
name: Build (Cross ${{ matrix.goos }}, Go ${{ matrix.goversion }})
|
|
|
|
needs: [lint]
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-05-28 00:14:28 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-28 01:15:34 +03:00
|
|
|
|
|
|
|
- name: Set up Go
|
2024-05-28 00:03:41 +03:00
|
|
|
uses: actions/setup-go@v5
|
2023-10-28 01:15:34 +03:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.goversion }}
|
|
|
|
|
|
|
|
- name: Build Yggdrasil
|
|
|
|
run: go build -v ./...
|
|
|
|
env:
|
|
|
|
GOOS: ${{ matrix.goos }}
|
|
|
|
|
2022-04-17 19:53:55 +03:00
|
|
|
tests-ok:
|
|
|
|
name: All tests passed
|
2022-04-18 12:33:33 +03:00
|
|
|
needs: [lint, codeql, build-linux, build-windows, build-macos]
|
2022-04-17 19:53:55 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ !cancelled() }}
|
|
|
|
steps:
|
|
|
|
- name: Check all tests passed
|
|
|
|
uses: re-actors/alls-green@release/v1
|
|
|
|
with:
|
2023-02-27 00:31:20 +03:00
|
|
|
jobs: ${{ toJSON(needs) }}
|