feat: Add image detection bindings #122
This file contains hidden or 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
| name: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| RUNNER_ARCH_MAP: '[{"amd64":"x86_64", "arm64":"aarch64", "arm":"armv7l"}]' | |
| GO_ARCH_MAP: '[{"amd64":"amd64", "arm64":"arm64", "arm":"armv6l"}]' | |
| DEB_ARCH_MAP: '[{"amd64":"amd64", "arm64":"arm64", "arm":"armhf"}]' | |
| jobs: | |
| build: | |
| runs-on: ${{ format('{0}-{1}', 'base-dind-2204', matrix.arch) }} | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64, arm] | |
| build-type: [release] | |
| fail-fast: false | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set arch variables | |
| run: | | |
| echo "ARCH=${{ fromJson(env.RUNNER_ARCH_MAP)[0][matrix.arch] }}" >> "$GITHUB_ENV" | |
| echo "DEB_ARCH=${{ fromJson(env.DEB_ARCH_MAP)[0][matrix.arch] }}" >> "$GITHUB_ENV" | |
| - name: Display Go version | |
| run: | | |
| go version | |
| - name: Install vaccel | |
| run: | | |
| wget "https://s3.nbfc.io/nbfc-assets/github/vaccel/rev/main/${{ env.ARCH }}/release/vaccel_latest_${{ env.DEB_ARCH }}.deb" | |
| sudo dpkg -i vaccel_latest_${{ env.DEB_ARCH }}.deb | |
| rm vaccel_latest_${{ env.DEB_ARCH }}.deb | |
| sudo ldconfig | |
| - name: Build binaries | |
| run: make | |
| - name: Test binaries | |
| env: | |
| VACCEL_LOG_LEVEL: 4 | |
| VACCEL_PLUGINS: libvaccel-noop.so | |
| run: | | |
| ./bin/noop | |
| ./bin/classify "$(pkg-config --variable=prefix vaccel)/share/vaccel/images/example.jpg" | |
| ./bin/exec "$(pkg-config --variable=libdir vaccel)/libmytestlib.so" 10 |