Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 0 additions & 191 deletions .github/workflows/auto-release.yml

This file was deleted.

129 changes: 12 additions & 117 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,123 +2,18 @@ name: CI

on:
push:
branches: [ main, master, develop ]
branches: [main]
pull_request:
branches: [ main, master, develop ]
branches: [main]

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.22', '1.23', '1.24']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-

- name: Download dependencies
run: go mod download

- name: Run tests
run: make test

- name: Run tests with coverage (Linux only)
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24'
run: make test-coverage

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24'
uses: codecov/codecov-action@v4
with:
file: ./coverage/coverage.out
flags: unittests
name: vessel-coverage

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.6.1
args: --timeout=5m
permissions:
contents: read
security-events: write

verify:
name: Verify
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Code is not formatted. Run 'make fmt'"
gofmt -l .
exit 1
fi

- name: Run go vet
run: make vet

- name: Check go.mod tidiness
run: |
go mod tidy
git diff --exit-code go.mod go.sum

security:
name: Security
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Run gosec
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec -exclude=G115 -exclude-dir=vendor ./...

- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
jobs:
ci:
uses: xraph/workflows/.github/workflows/go-ci.yml@v1
with:
go-versions: '["1.25","1.26"]'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
42 changes: 11 additions & 31 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,19 @@ name: CodeQL

on:
push:
branches: [ main, master, develop ]
branches: [main]
pull_request:
branches: [ main, master, develop ]
branches: [main]
schedule:
- cron: '0 0 * * 1' # Weekly on Monday at midnight
- cron: '0 0 * * 1'

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
uses: xraph/workflows/.github/workflows/codeql.yml@v1
with:
go-version: '1.26'
Loading