Skip to content

Further fix attempt #1028

Further fix attempt

Further fix attempt #1028

Workflow file for this run

name: LAPIS-SILO
on:
push:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_IMAGE_NAME: ghcr.io/GenSpectrum/LAPIS-SILO
DOCKER_TEST_IMAGE_NAME: silo/unittests
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- check: 'src'
- check: 'include'
exclude: '(PerfEvent.hpp)'
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: '16'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
linter:
name: Build And Run linter
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build linter image
uses: docker/build-push-action@v4
with:
context: .
push: false
target: linter
tags: ${{ env.DOCKER_TEST_IMAGE_NAME }}
cache-from: type=gha,scope=${{ github.ref_name }}-linter-image-cache
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-linter-image-cache
file: Dockerfile_linter
dockerImage:
name: Build And Run Unit Tests
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build unit test image
uses: docker/build-push-action@v4
with:
context: .
push: false
load: true
target: builder
tags: ${{ env.DOCKER_TEST_IMAGE_NAME }}
cache-from: type=gha,scope=${{ github.ref_name }}-image-cache
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-image-cache
-
name: Run tests
uses: addnab/docker-run-action@v3
with:
image: ${{ env.DOCKER_TEST_IMAGE_NAME }}
run: ./silo_test
-
name: Docker metadata
id: dockerMetadata
uses: docker/metadata-action@v4
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 production image
if: ${{ github.event_name == 'push' }}
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.dockerMetadata.outputs.tags }}
endToEndTests:
name: Run End To End Tests
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
-
uses: actions/checkout@v3
-
name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18.x
-
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-
name: npm install
run: cd endToEndTests && npm ci
-
name: Check Format
run: cd endToEndTests && npm run check-format
-
name: Docker Metadata
id: dockerMetadata
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE_NAME }}
tags: type=ref,event=branch
-
name: Wait for Docker Image
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.ref }}
check-name: Build And Run Unit Tests
repo-token: ${{ secrets.GITHUB_TOKEN }}
-
name: Start Docker Container
run: docker compose -f docker-compose-for-tests.yml up -d --wait
env:
SILO_IMAGE: ${{ steps.dockerMetadata.outputs.tags }}
-
name: Run Tests
run: cd endToEndTests && SILO_URL=localhost:8080 npm run test