mirror of
https://github.com/guggero/chantools.git
synced 2026-08-13 12:33:34 +02:00
87 lines
1.8 KiB
YAML
87 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
concurrency:
|
|
# Cancel any previous workflows if they are from a PR or push.
|
|
group: ${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
env:
|
|
GO_VERSION: 1.24.10
|
|
LINT_VERSION: v2.6.2
|
|
|
|
jobs:
|
|
########################
|
|
# lint code
|
|
########################
|
|
lint:
|
|
name: lint code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '${{ env.GO_VERSION }}'
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: '${{ env.LINT_VERSION }}'
|
|
|
|
########################
|
|
# run unit tests
|
|
########################
|
|
unit-test:
|
|
name: run unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '${{ env.GO_VERSION }}'
|
|
|
|
- name: Install chantools
|
|
run: make install
|
|
|
|
- name: run unit tests
|
|
run: make unit
|
|
|
|
########################
|
|
# run integration tests
|
|
########################
|
|
integration-test:
|
|
name: run integration tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '${{ env.GO_VERSION }}'
|
|
|
|
- name: Install chantools
|
|
run: make install
|
|
|
|
- name: run integration tests
|
|
run: make itest
|