Merge branch 'master' into develop #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go CI | |
| on: | |
| pull_request: | |
| branches: [develop, master] | |
| push: | |
| branches: [develop, master] | |
| jobs: | |
| build-linux: | |
| name: Build stringFormatter on linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5.2.0 | |
| with: | |
| go-version: '1.21' | |
| - name: Build | |
| run: go version && go build -v ./... | |
| build-windows: | |
| name: Build stringFormatter on windows | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5.2.0 | |
| with: | |
| go-version: '1.21' | |
| - name: Build | |
| run: go version && go build -v ./... | |
| all-tests-linux: | |
| name: Run all tests on linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5.2.0 | |
| with: | |
| go-version: '1.21' | |
| - name: Test all | |
| run: go version && go mod tidy && go test -v -covermode=count -coverprofile=coverage.out ./... | |
| - name: Upload coverage to Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| # If your repo is private, uncomment the next line and set the secret | |
| # coveralls-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| path-to-lcov: coverage.out | |
| benchmark-tests: | |
| name: Run benchmark tests on linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5.2.0 | |
| with: | |
| go-version: '1.21' | |
| - name: Benchmark all | |
| run: go test -bench=. -run=^$ ./... -cpu 1 | tee benchmark_output.txt | |
| - name: Store and Track Benchmarks | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: Go Benchmark Results | |
| tool: 'go' | |
| output-file-path: benchmark_output.txt | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: true | |
| # This saves results directly into a "benchmark" folder on your gh-pages branch | |
| benchmark-data-dir-path: 'benchmarks' | |
| #all-tests-windows: | |
| # name: Run all tests on windows | |
| # runs-on: windows-latest | |
| # steps: | |
| # - uses: actions/checkout@v4.1.7 | |
| # - name: Set up Go | |
| # uses: actions/setup-go@v5.0.2 | |
| # - name: Test all | |
| # run: go test -v ./... | |
| # on windows don't work linux containers by default | |
| lint: | |
| name: Run golangci linters | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5.2.0 | |
| with: | |
| go-version: '1.21' | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v6.1.0 | |
| with: | |
| version: v1.63.4 | |
| args: --timeout 3m --config .golangci.yaml |