Skip to content

Commit

Permalink
Merge pull request #96 from klippa-app/feature/update-to-pdfium-5961
Browse files Browse the repository at this point in the history
Update to pdfium 5961 and Wazero v1.5.0
  • Loading branch information
jerbob92 authored Aug 24, 2023
2 parents 2b0a6a7 + e78afc8 commit cc884b6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 21 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [ "1.18", "1.19", "1.20" ]
pdfium: [ "4849", "4874", "4929", "5038", "5079", "5254", "5378", "5664", "5854", "5907" ]
go: [ "1.19", "1.20", "1.21" ]
pdfium: [ "4849", "5961" ]
env:
PDFIUM_EXPERIMENTAL_VERSION: "5907"
PDFIUM_EXPERIMENTAL_GO_VERSION: "1.20"
PDFIUM_EXPERIMENTAL_VERSION: "5961"
PDFIUM_EXPERIMENTAL_GO_VERSION: "1.21"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Set up PDFium library (Linux)
Expand Down Expand Up @@ -54,13 +54,11 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export GODEBUG=cgocheck=2
go test -timeout 30m `go list ./... | grep -v webassembly` -exec "env DYLD_LIBRARY_PATH=/opt/pdfium/lib" -v
- name: Test all packages (Linux & MacOS) - Experimental
if: (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && matrix.pdfium == env.PDFIUM_EXPERIMENTAL_VERSION
run: |
export LD_LIBRARY_PATH="/opt/pdfium/lib"
export GODEBUG=cgocheck=2
export IS_EXPERIMENTAL="1"
go test -timeout 30m `go list ./... | grep -v webassembly` -tags pdfium_experimental -exec "env DYLD_LIBRARY_PATH=/opt/pdfium/lib" -v
- name: Test all packages (Windows)
Expand All @@ -84,29 +82,29 @@ jobs:
go test -timeout 30m ./internal/implementation_cgo ./internal/implementation_webassembly -coverprofile=coverage.out -covermode=atomic -tags pdfium_experimental -v
- name: Archive code coverage results
if: matrix.os == 'ubuntu-latest' && matrix.go == env.PDFIUM_EXPERIMENTAL_GO_VERSION && matrix.pdfium == env.PDFIUM_EXPERIMENTAL_VERSION
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: ./coverage.out
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.go == env.PDFIUM_EXPERIMENTAL_GO_VERSION && matrix.pdfium == env.PDFIUM_EXPERIMENTAL_VERSION
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: coverage.out
test-webassembly:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [ "1.18", "1.19", "1.20" ]
go: [ "1.19", "1.20", "1.21" ]
env:
PDFIUM_EXPERIMENTAL_GO_VERSION: "1.20"
PDFIUM_EXPERIMENTAL_GO_VERSION: "1.21"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Test all packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pdfium-windows.pc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ includedir=D:/opt/pdfium/include

Name: PDFium
Description: PDFium
Version: 5907
Version: 5961
Requires:

Libs: -L${libdir} -lpdfium
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pdfium.pc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ includedir=/opt/pdfium/include

Name: PDFium
Description: PDFium
Version: 5907
Version: 5961
Requires:

Libs: -L${libdir} -lpdfium
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ includedir={path}/include
Name: PDFium
Description: PDFium
Version: 5907
Version: 5961
Requires:
Libs: -L${libdir} -lpdfium
Expand Down Expand Up @@ -655,6 +655,22 @@ single-threaded or WebAssembly usage. It's not possible to encode the `io.Writer
processes for that
matter.

## Support Policy

We offer an API stability promise with semantic versioning. In other words, we promise to not break any exported
function signature without incrementing the major version. New features and behaviors happen with a minor version
increment, e.g. 1.0.11 to 1.1.0. We also fix bugs or change internal details with a patch version, e.g. 1.0.0 to 1.0.1.
Upgrades of the supported PDFium version will cause a minor version update.

### Go

This project will support the last 3 version of Go, this means that if the last version of Go is 1.21, our `go.mod`
will be set to Go 1.19, and our CI tests will be run on Go 1.19, 1.20 and 1.21. It won't mean that the library won't
work with older versions of Go, but it will tell you what to expect of the supported Go versions. If we change the
supported Go versions, we will make that a minor version upgrade. This policy allows you to not be forced to the latest
Go version for a pretty long time, but it still allows us to use new language features in a pretty reasonable
time-frame.

## About Klippa

Founded in 2015, [Klippa](https://www.klippa.com/en)'s goal is to digitize & automate administrative processes with
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/klippa-app/go-pdfium

go 1.18
go 1.19

require (
github.com/google/uuid v1.3.1
Expand All @@ -10,7 +10,7 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/stretchr/testify v1.8.4
github.com/tetratelabs/wazero v1.4.0
github.com/tetratelabs/wazero v1.5.0
golang.org/x/net v0.14.0
golang.org/x/text v0.12.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tetratelabs/wazero v1.4.0 h1:9/MirYvmkJ/zSUOygKY/ia3t+e+RqIZXKbylIby1WYk=
github.com/tetratelabs/wazero v1.4.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0=
github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
Expand Down
Binary file modified webassembly/pdfium.wasm
Binary file not shown.

0 comments on commit cc884b6

Please sign in to comment.