Merge pull request #12 from DataDog/maxime/test-matrix

Add test matrix
master
maxime mouial 2018-12-10 10:29:50 -07:00 committed by GitHub
commit 59853178c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 0 deletions

43
.circleci/config.yml Normal file
View File

@ -0,0 +1,43 @@
version: 2
templates:
job_template: &job_template
working_directory: /go/src/github.com/DataDog/go-python3
docker:
- image: golang:1.11.2
jobs:
python3.5:
<<: *job_template
steps:
- checkout
- run: echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
- run: apt-get update && apt-get install -y python3.5-dev
- run: cp /usr/lib/x86_64-linux-gnu/pkgconfig/python-3.5.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python3.pc
- run: cd test && go build && ./test
python3.6:
<<: *job_template
steps:
- checkout
- run: echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
- run: apt-get update && apt-get install -y python3.6-dev
- run: cp /usr/lib/x86_64-linux-gnu/pkgconfig/python-3.6.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python3.pc
- run: cd test && go build && ./test
python3.7:
<<: *job_template
steps:
- checkout
- run: echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list
- run: apt-get update && apt-get install -y python3.7-dev
- run: cp /usr/lib/x86_64-linux-gnu/pkgconfig/python-3.7.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python3.pc
- run: cd test && go build && ./test
workflows:
version: 2
build_test_deploy:
jobs:
- python3.5
- python3.6
- python3.7

18
test/main.go Normal file
View File

@ -0,0 +1,18 @@
package main
/*
#cgo pkg-config: python3
#include "Python.h"
*/
import "C"
import (
"fmt"
python "github.com/DataDog/go-python3"
)
func main() {
C.Py_Initialize()
ret, err := python.PyRun_AnyFile("test.py")
fmt.Printf("%d %v\n", ret, err)
}

3
test/test.py Normal file
View File

@ -0,0 +1,3 @@
import sys
print(sys.version)