mirror of
https://github.com/kjanat/articulate-parser.git
synced 2026-01-16 15:02:09 +01:00
* Update ci.yml * Disable codeql.yml because of private repo status * Update release.yml to set prerelease status if tag starts with v0 * Disable dependency-review.yml because of private repo status
60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, develop]
|
|
pull_request:
|
|
branches: [master, develop]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go: [1.21.x, 1.22.x, 1.23.x, 1.24.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go ${{ matrix.go }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
check-latest: true
|
|
cache-dependency-path: "**/*.sum"
|
|
|
|
- name: Download dependencies
|
|
run: go mod download && echo "Download successful" || go mod tidy && echo "Tidy successful" || return 1
|
|
|
|
- name: Verify dependencies
|
|
run: go mod verify
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Run tests
|
|
run: go test -v -race -coverprofile=coverage.out ./...
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|
|
|
|
- name: Run go fmt
|
|
run: |
|
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
|
echo "The following files are not formatted:"
|
|
gofmt -s -l .
|
|
exit 1
|
|
fi
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
slug: kjanat/articulate-parser
|
|
|
|
- name: Upload test results to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/test-results-action@v1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|