Skip to content

CI

CI #876

Workflow file for this run

name: CI
on:
push:
branches: [master, develop]
pull_request:
branches: [master]
schedule:
- cron: '0 14 */15 * *'
permissions:
actions: read
contents: read
statuses: write
jobs:
Linux:
name: Linux
runs-on: ubuntu-latest
env:
SRC_DIR: src/github.com/${{ github.repository }}
EK_TEST_PORT: 8080
strategy:
matrix:
go: [ '1.19.x', '1.20.x' ]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}
- uses: actions/cache@v3
id: cache-deps
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-essentialkaos-ek-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make deps
- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: .scripts/nix.sh 12
- name: Send coverage data
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{env.SRC_DIR}}
profile: coverage.txt
parallel: true
flag-name: linux-${{ matrix.go }}
macOS:
name: macOS
runs-on: macos-latest
needs: Linux
env:
SRC_DIR: src/github.com/${{ github.repository }}
EK_TEST_PORT: 8080
strategy:
matrix:
go: [ '1.19.x', '1.20.x' ]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}
- uses: actions/cache@v3
id: cache-deps
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-essentialkaos-ek-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make deps
- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: .scripts/nix.sh 12
- name: Send coverage data
uses: essentialkaos/goveralls-action@v1
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{env.SRC_DIR}}
profile: coverage.txt
parallel: true
flag-name: macos-${{ matrix.go }}
Windows:
name: Windows (Stubs)
runs-on: windows-latest
env:
SRC_DIR: src/github.com/${{ github.repository }}
EK_TEST_PORT: 8080
strategy:
matrix:
go: [ '1.19.x', '1.20.x' ]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}
- name: Run tests on Windows
working-directory: ${{env.SRC_DIR}}
run: .scripts/windows.sh 12
SendCoverage:
name: Send Coverage
runs-on: ubuntu-latest
needs: [Linux, macOS]
steps:
- name: Finish parallel tests
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
parallel-finished: true
Typos:
name: Typos
runs-on: ubuntu-latest
needs: SendCoverage
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check spelling
continue-on-error: true
uses: crate-ci/typos@master
Lint:
name: Lint
runs-on: ${{ matrix.os }}
needs: SendCoverage
env:
SRC_DIR: src/github.com/${{ github.repository }}
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19.x'
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
working-directory: ${{env.SRC_DIR}}
args: --issues-exit-code=0 --timeout=3m --build-tags=unit