Skip to content

Merge pull request #3 from gotray/coverage #10

Merge pull request #3 from gotray/coverage

Merge pull request #3 from gotray/coverage #10

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-24.04
- windows-latest
defaults:
run:
shell: bash
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- uses: actions/setup-python@v5
with:
python-version: '3.13'
update-environment: true
- name: Generate Python pkg-config for windows (patch)
if: matrix.os == 'windows-latest'
run: |
mkdir -p $PKG_CONFIG_PATH
cp .github/assets/python3-embed.pc $PKG_CONFIG_PATH/
- name: Install tiny-pkg-config for windows (patch)
if: matrix.os == 'windows-latest'
run: |
set -x
curl -L https://github.com/cpunion/tiny-pkg-config/releases/download/v0.2.0/tiny-pkg-config_Windows_x86_64.zip -o /tmp/tiny-pkg-config.zip
unzip /tmp/tiny-pkg-config.zip -d $HOME/bin
mv $HOME/bin/tiny-pkg-config.exe $HOME/bin/pkg-config.exe
echo $PKG_CONFIG_PATH
cat $PKG_CONFIG_PATH/python3-embed.pc
pkg-config --libs python3-embed
pkg-config --cflags python3-embed
- name: Build
run: go install -v ./...
- name: Test with coverage
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true