Skip to content

Alpha Version

Alpha Version #66

Workflow file for this run

name: Tests
on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize, labeled]
jobs:
test:
if: github.event_name == 'pull_request' && (github.event.pull_request.draft == false ||
(github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name, 'testing')))
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.25.5]
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- 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 Go modules
run: go mod download
- name: Run calculator tests
run: |
go test -race -coverpkg=./... ./calculator/... -coverprofile=coverage-calculator-${{ matrix.go-version }}.out
go tool cover -func=coverage-calculator-${{ matrix.go-version }}.out | tail -n 1
- name: Run exceptions tests
run: |
go test -race -coverpkg=./... ./exception/... -coverprofile=coverage-exception-${{ matrix.go-version }}.out
go tool cover -func=coverage-exception-${{ matrix.go-version }}.out | tail -n 1
- name: Run exchange tests
run: |
go test -race -coverpkg=./... ./exchange/... -coverprofile=coverage-exchange-${{ matrix.go-version }}.out
go tool cover -func=coverage-exchange-${{ matrix.go-version }}.out | tail -n 1
- name: Run parser tests
run: |
go test -race -coverpkg=./... ./parser/... -coverprofile=coverage-parser-${{ matrix.go-version }}.out
go tool cover -func=coverage-parser-${{ matrix.go-version }}.out | tail -n 1
- name: Run money tests
run: |
go test -race -coverpkg=./... ./money/... -coverprofile=coverage-money-${{ matrix.go-version }}.out
go tool cover -func=coverage-money-${{ matrix.go-version }}.out | tail -n 1
- name: Merge coverage reports
run: |
echo "mode: set" > coverage-${{ matrix.go-version }}.out
tail -q -n +2 coverage-*-${{ matrix.go-version }}.out >> coverage-${{ matrix.go-version }}.out
go tool cover -func=coverage-${{ matrix.go-version }}.out | tail -n 1