git-chglog/.github/workflows/ci.yml
Manuel Vogel f3cf5b67a0
fix(ci): add integration test with docker image (#226)
* fix: add git safe directory for /workdir
* chore: use docker staged build
2023-02-11 10:54:32 +01:00

90 lines
No EOL
2.2 KiB
YAML

name: ci
on:
pull_request:
types: ["opened", "synchronize"]
paths-ignore:
- "README.md"
push:
branches:
- master
paths-ignore:
- "README.md"
env:
GO_VERSION: "1.19"
GOLANGCI_VERSION: "v1.50.1"
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Run tests
run: make test
- name: Install goveralls
run: go get github.com/mattn/goveralls
env:
GO111MODULE: off
- name: Send coverage
run: goveralls -coverprofile=cover.out -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
integration-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Updating and upgrading brew
if: matrix.os == 'macos-latest'
run: |
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew --version
- name: Install docker-cli and start colima
if: matrix.os == 'macos-latest'
# https://github.com/docker/for-mac/issues/2359#issuecomment-943131345
run: |
brew install docker
colima start
docker info
- name: Test docker image
run: |
docker build -t git-chglog:ci-build .
docker run -v ${GITHUB_WORKSPACE}:/workdir -w /workdir git-chglog:ci-build > ${GITHUB_WORKSPACE}/ci-build.md
head ${GITHUB_WORKSPACE}/ci-build.md