Skip to content

Commit

Permalink
ci: update ci configuration
Browse files Browse the repository at this point in the history
The previous configuration is badly outdated and needs to be updated.
In the new version, I removed the checks for the dependency option
without go modules, and also removed all old versions of go, as I don't
intend to support them in the future.

For convenience, added manual startup for workflow.
  • Loading branch information
xorcare committed Jan 26, 2024
1 parent aa7cae0 commit 814d7a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 66 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: [ master ]
schedule:
- cron: '44 5 * * 5'
workflow_dispatch:

jobs:
analyze:
Expand Down
85 changes: 19 additions & 66 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,35 @@ name: Continuous Integration

on:
push:
branches: [ master ]
branches:
pull_request:
branches: [ master ]
branches: [ "main" ]
workflow_dispatch:

jobs:
ci:
name: Static analysis and testing
env:
GO111MODULE: on
strategy:
matrix:
go:
- '1.16'
- '1.15'
- '1.14'
- '1.13'
- '1.12'
- '1.11'
os:
- 'ubuntu-18.04'
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
go-version: '1.21'
cache: false

- name: Check that all packages are compiling
run: make build

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run all test
run: make test

- name: Installing tools
run: make tools

- name: Static analysis and testing
run: |
export GOPATH=$HOME/go
export GOBIN=$(go env GOPATH)/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOBIN
make check
- name: Codecov
uses: codecov/codecov-action@v1

ci-without-go-modules:
name: Testing without Go modules
env:
GO111MODULE: off
strategy:
matrix:
go:
- '1.11'
- '1.10'
- '1.9'
- '1.8'
os:
- 'ubuntu-18.04'
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run all checks
run: make check

- name: Testing
run: |
export GOPATH=$HOME/go
export GOBIN=$(go env GOPATH)/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOBIN
mkdir -p $GOPATH/pkg
mkdir -p $GOBIN
mkdir -p $GOPATH/src/github.com/$GITHUB_REPOSITORY
mv $(pwd)/* $GOPATH/src/github.com/$GITHUB_REPOSITORY
cd $GOPATH/src/github.com/$GITHUB_REPOSITORY
go test ./... -count=10 -race
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

0 comments on commit 814d7a6

Please sign in to comment.