Skip to content

jsnoble is testing the Teraslice Asset #496

jsnoble is testing the Teraslice Asset

jsnoble is testing the Teraslice Asset #496

Workflow file for this run

name: Test Teraslice Asset
run-name: ${{ github.actor }} is testing the Teraslice Asset
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
check-docker-limit-before:
uses: terascope/workflows/.github/workflows/check-docker-limit.yml@2a097b4af7eb81cebc7d602ad9ab2f1ef7b979cc
secrets: inherit
cache-docker-images:
needs: check-docker-limit-before
uses: terascope/workflows/.github/workflows/cache-docker-images.yml@2a097b4af7eb81cebc7d602ad9ab2f1ef7b979cc
secrets: inherit
test-elasticsearch-assets:
runs-on: ubuntu-latest
needs: cache-docker-images
env:
NODE_OPTIONS: "--max-old-space-size=4096"
strategy:
# opensearch is finiky, keep testing others if it fails
fail-fast: false
matrix:
# NOTE: Hard Coded Node Version array, should match array in build-and-publish-asset.yml
node-version: [18, 20, 22]
search-version: [elasticsearch6, elasticsearch7, opensearch1, opensearch2]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
# we login to docker to avoid docker pull limit rates
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: yarn setup
- run: yarn lint
- name: Create Docker Image List
run: |
yarn docker:listImages
cat ./images/image-list.txt
- name: Restore Docker image cache
id: docker-cache
uses: actions/cache@v4
with:
path: /tmp/docker_cache
key: docker-images-${{ hashFiles('./images/image-list.txt') }}
- name: Test asset for ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
- name: Test apis for ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
working-directory: ./packages/elasticsearch-asset-apis
- run: yarn global add teraslice-cli
- run: teraslice-cli -v
- run: teraslice-cli assets build
- run: ls -l build/
check-docker-limit-after:
needs: test-elasticsearch-assets
uses: terascope/workflows/.github/workflows/check-docker-limit.yml@2a097b4af7eb81cebc7d602ad9ab2f1ef7b979cc
secrets: inherit
# TODO:
# - Add Macos Test
# - Add post test build verify for all supported node versions, no Opensearch/ES
# test-macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# # NOTE: Hard Coded Node Version
# node-version: '18.18.2'
# - run: yarn setup
# - run: yarn lint
# # TODO: Ideally we'd be able to at least run unit tests that don't require docker.
# #- run: yarn test:all
# - run: yarn global add teraslice-cli
# - run: teraslice-cli -v
# - run: teraslice-cli assets build
# - run: ls -l build/