feat(lapis2): stream data from SILO #1737
Workflow file for this run
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: LAPIS v2 | |
on: [ push ] | |
env: | |
DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis-v2 | |
jobs: | |
Tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
- name: Execute Tests | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: test | |
build-root-directory: lapis2 | |
- name: Check Format And Lint | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: ktlintCheck | |
build-root-directory: lapis2 | |
dockerImage: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker metadata | |
id: dockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
- name: Build and push image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./lapis2 | |
tags: ${{ steps.dockerMetadata.outputs.tags }} | |
cache-from: type=gha,scope=lapis2-${{ github.ref }} | |
cache-to: type=gha,mode=max,scope=lapis2-${{ github.ref }} | |
platforms: ${{ github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | |
push: true | |
endToEndTests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Build OpenAPI Spec | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: generateOpenApiDocs | |
build-root-directory: lapis2 | |
- name: Build OpenAPI Spec Protected | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: generateOpenApiDocs -PopennessLevel=protected | |
build-root-directory: lapis2 | |
- name: Cache .npm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('siloLapisTests/**/package-lock.json') }} | |
- name: Prepare Tests | |
run: npm ci | |
working-directory: siloLapisTests | |
- name: Generate Lapis Client | |
run: npm run generateLapisClient | |
working-directory: siloLapisTests | |
- name: Generate Lapis Client Protected | |
run: npm run generateLapisClientProtected | |
working-directory: siloLapisTests | |
- name: Check Format | |
run: npm run check-format | |
working-directory: siloLapisTests | |
- name: Docker metadata | |
id: dockerMetadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }} | |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | |
- name: Get LAPIS Branch Tag | |
id: lapisBranchTag | |
env: | |
TAG: ${{ steps.dockerMetadata.outputs.tags }} | |
run: echo "lapisTag=${TAG##*:}" >> $GITHUB_OUTPUT | |
- name: Wait for Docker Image | |
uses: lewagon/wait-on-check-action@v1.3.4 | |
with: | |
ref: ${{ github.ref }} | |
check-name: Build Docker Image | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Start SILO and LAPIS and Run Tests | |
run: | | |
docker compose -f lapis2/docker-compose.yml pull | |
docker compose -f lapis2/docker-compose.yml up -d --wait | |
cd siloLapisTests && npm run test | |
env: | |
SILO_TAG: latest | |
LAPIS_TAG: ${{ steps.lapisBranchTag.outputs.lapisTag }} | |
- name: Store Logs | |
if: ${{ always() }} | |
run: | | |
cd lapis2 | |
mkdir p e2e-logs | |
docker compose logs silo > e2e-logs/silo.log | |
docker compose logs lapisOpen > e2e-logs/lapisOpen.log | |
docker compose logs lapisProtected > e2e-logs/lapisProtected.log | |
env: | |
SILO_TAG: latest | |
LAPIS_TAG: ${{ steps.lapisBranchTag.outputs.lapisTag }} | |
- name: Upload logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs | |
path: lapis2/e2e-logs |