Use libmagic to identify files type. (#1124)

* Use libmagic to identify file types.

* Fix mime array for database querying.

* go mod tidy

* Fix typo

* Another fix for the scheduled image build workflow for tag case (#1137)

* Try to fix the incorrect tag processing

* more debug code

* try with context=git

* hopefully, final debug

* the final commit with no debug code

---------

Co-authored-by: Konstantin Koval

* Add benchmark.

* rollback workflows.

* Fix AI comments.

* Build image.

* Fix AI comments.

* Fix AI comments.

* Rollback build workflow.

---------

Co-authored-by: Kostiantyn <32730812+kkovaletp@users.noreply.github.com>
This commit is contained in:
Googol Lee
2024-12-14 22:07:03 +01:00
committed by GitHub
parent f1d4d0a048
commit f88fcaba69
19 changed files with 572 additions and 494 deletions

5
scripts/benchmark_api.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname $0)/../api"
go test ./... -bench . -benchmem

View File

@@ -11,5 +11,8 @@ apt-get install -y libdav1d-dev:${DEB_HOST_ARCH} libde265-dev:${DEB_HOST_ARCH} l
apt-get install -y \
libdlib-dev:${DEB_HOST_ARCH} libblas-dev:${DEB_HOST_ARCH} libatlas-base-dev:${DEB_HOST_ARCH} liblapack-dev:${DEB_HOST_ARCH} libjpeg62-turbo-dev:${DEB_HOST_ARCH}
# Install gomagic dependencies
apt-get install -y libmagic-dev:${DEB_HOST_ARCH}
# Install tools for development
apt-get install -y reflex sqlite3

View File

@@ -12,3 +12,5 @@ apt-get install -y libjpeg62-turbo liblcms2-2 zlib1g libgomp1
apt-get install -y libjxl0.7 liblcms2-2 liblqr-1-0 libdjvulibre21 libjpeg62-turbo libopenjp2-7 libopenexr-3-1-30 libpng16-16 libtiff6 libwebpmux3 libwebpdemux2 libwebp7 libxml2 zlib1g liblzma5 libbz2-1.0 libgomp1
# go-face dependencies
apt-get install -y libdlib19.1 libblas3 liblapack3 libjpeg62-turbo
# libmagic dependencies
apt-get install -y libmagic1

View File

@@ -1,5 +1,5 @@
#!/bin/bash
set -euxo pipefail
cd $(dirname $0)/../api
cd "$(dirname $0)/../api"
go test ./... -v -database -filesystem -p 1 -coverprofile=coverage.txt -covermode=atomic 2>&1 | tee >(go-junit-report >test-api-coverage-report.xml)