mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 06:00:28 +00:00
Update GitHub Actions
This commit is contained in:
parent
93c94e38f9
commit
c7ffbc05a5
81
.github/workflows/ci.yml
vendored
81
.github/workflows/ci.yml
vendored
@ -2,19 +2,33 @@ name: Yggdrasil
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master develop ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master develop ]
|
|
||||||
release:
|
release:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-test:
|
lint:
|
||||||
name: Go ${{ matrix.goversion }}
|
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:
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
goversion: ["1.16", "1.17", "1.18"]
|
goversion: ["1.16", "1.17", "1.18"]
|
||||||
|
|
||||||
|
name: Build & Test (Linux, Go ${{ matrix.goversion }})
|
||||||
|
needs: [lint]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -29,3 +43,62 @@ jobs:
|
|||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
run: go test -v ./...
|
run: go test -v ./...
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
goversion: ["1.16", "1.17", "1.18"]
|
||||||
|
|
||||||
|
name: Build & Test (Windows, Go ${{ matrix.goversion }})
|
||||||
|
needs: [lint]
|
||||||
|
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.goversion }}
|
||||||
|
|
||||||
|
- name: Build Yggdrasil
|
||||||
|
run: go build -v ./...
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
goversion: ["1.16", "1.17", "1.18"]
|
||||||
|
|
||||||
|
name: Build & Test (macOS, Go ${{ matrix.goversion }})
|
||||||
|
needs: [lint]
|
||||||
|
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.goversion }}
|
||||||
|
|
||||||
|
- name: Build Yggdrasil
|
||||||
|
run: go build -v ./...
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
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) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user