mirror of
https://github.com/guggero/chantools.git
synced 2026-08-13 12:33:34 +02:00
84 lines
1.7 KiB
YAML
84 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
env:
|
|
GO_VERSION: 1.23.9
|
|
|
|
jobs:
|
|
########################
|
|
# lint code
|
|
########################
|
|
lint:
|
|
name: lint code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: create linter cache directory
|
|
run: mkdir -p /tmp/go-lint-cache
|
|
|
|
- name: linter cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
/tmp/go-lint-cache
|
|
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-linter-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: lint
|
|
run: make lint
|
|
|
|
########################
|
|
# 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
|