Add linux arm64 docker test #80
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
name: Test Install & Import on Docker | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
node: ['14', '16', '18', '20'] | |
platform: [ | |
{ | |
distro: '', | |
arch: 'linux/amd64' | |
}, | |
{ | |
distro: '', | |
arch: 'linux/arm64' | |
}, | |
{ | |
distro: '-buster', | |
arch: 'linux/amd64' | |
}, | |
{ | |
distro: '-bullseye', | |
arch: 'linux/amd64' | |
}, | |
{ | |
distro: '-alpine', | |
arch: 'linux/amd64' | |
}, | |
{ | |
distro: '-alpine', | |
arch: 'linux/arm64' | |
}, | |
# { | |
# distro: '-alpine', | |
# arch: 'linux/arm/v7' | |
# } | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: NPM Pack | |
run: npm pack | |
- name: Rename Package | |
run: mv faiss-node-*.tgz test-import/faiss-node.tgz | |
- name: Build docker on node:${{ matrix.node }}${{ matrix.platform.distro }} | |
working-directory: ./test-import | |
run: docker buildx build --platform ${{ matrix.platform.arch }} -o type=docker -t test-import --build-arg BASE_IMAGE=node:${{ matrix.node }}${{ matrix.platform.distro }} . | |
- name: Run test | |
working-directory: ./test-import | |
run: docker run --platform ${{ matrix.platform.arch }} test-import |