-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions CI workflows (#196)
* Add CI workflows for building the package and dependencies * Init Go module for examples * Remove unused artifacts from deps * Patch OpenCV on Linux to fix invalid syntax * Disable unused python and java OpenCV bindings * Reduce max ImageOps size to avoid running out of memory * Close ImageOps when we're done with each test case * Clarify webp test names * Run CI on either main or master branch
- Loading branch information
Showing
8 changed files
with
210 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
runs-on: | ||
- macos-14 | ||
- ubuntu-22.04 | ||
fail-fast: false | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: "1.23" | ||
|
||
- name: Build | ||
run: go build | ||
|
||
- name: Test | ||
run: go test -v | ||
|
||
- name: Build examples | ||
run: | | ||
cd examples | ||
go build |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Build dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
paths: | ||
- 'deps/**' | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
paths: | ||
- 'deps/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
linux: | ||
name: Linux | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install build tools | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install nasm | ||
- name: Build deps | ||
run: | | ||
export MAKEFLAGS="-j$(nproc)" | ||
./deps/build-deps-linux.sh | ||
- run: | | ||
git status | ||
git diff | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: "1.23" | ||
|
||
- name: Build and test lilliput with the new deps | ||
run: | | ||
go build | ||
go test -v | ||
- name: Compress deps | ||
run: tar -czf deps.tar.gz deps/linux | ||
|
||
- name: Upload deps artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: deps-linux.tar.gz | ||
path: deps.tar.gz | ||
|
||
macos: | ||
name: macOS | ||
runs-on: macos-14 | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install build tools | ||
run: | | ||
brew install autoconf | ||
brew install automake | ||
brew install coreutils # for ffmpeg build | ||
brew install libtool | ||
- name: Build deps | ||
run: | | ||
export MAKEFLAGS="-j$(nproc)" | ||
./deps/build-deps-osx.sh | ||
- run: | | ||
git status | ||
git diff | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: "1.23" | ||
|
||
- name: Build and test lilliput with the new deps | ||
run: | | ||
go build | ||
go test -v | ||
- name: Compress deps | ||
run: tar -czf deps.tar.gz deps/osx | ||
|
||
- name: Upload deps artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: deps-macos.tar.gz | ||
path: deps.tar.gz |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake | ||
index 5bb0479..3d07b1c 100644 | ||
--- a/cmake/OpenCVCompilerOptions.cmake | ||
+++ b/cmake/OpenCVCompilerOptions.cmake | ||
@@ -18,8 +18,6 @@ if(ENABLE_CCACHE AND NOT CMAKE_COMPILER_IS_CCACHE) | ||
message(STATUS "Unable to compile program with enabled ccache, reverting...") | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${__OLD_RULE_LAUNCH_COMPILE}") | ||
endif() | ||
- else() | ||
- message(STATUS "Looking for ccache - not found") | ||
endif() | ||
endif() | ||
endif() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module example | ||
|
||
go 1.23.2 | ||
|
||
require github.com/discord/lilliput v0.0.0-20241012171911-37dccacf7c50 // indirect | ||
|
||
replace github.com/discord/lilliput => .. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/discord/lilliput v0.0.0-20241012171911-37dccacf7c50 h1:5tSOh98txNCq1k4SwG4ZYCBjKjNg3fXHfdjOv8t4kBk= | ||
github.com/discord/lilliput v0.0.0-20241012171911-37dccacf7c50/go.mod h1:0euuUBAD72MAYRm2ElLaG1h0nBR+CgpfnKc/U6y/uE8= |
This file contains 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