cleaning up unused files and some code edits #1408
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-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@v4 | |
- name: Run clang-format style check | |
uses: jidicula/[email protected] | |
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@v4 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build linter image | |
uses: docker/build-push-action@v5 | |
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@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: Build unit test image | |
uses: docker/build-push-action@v5 | |
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@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 production image | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/build-push-action@v5 | |
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@v4 | |
- | |
name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
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@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: type=ref,event=branch | |
- | |
name: Wait for Docker Image | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.ref }} | |
check-name: Build And Run Unit Tests | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Start Docker Container and preprocess data | |
run: docker compose -f docker-compose-for-tests-preprocessing.yml up | |
env: | |
SILO_IMAGE: ${{ steps.dockerMetadata.outputs.tags }} | |
- name: Start Docker Container and run api | |
run: docker compose -f docker-compose-for-tests-api.yml up -d --wait | |
env: | |
SILO_IMAGE: ${{ steps.dockerMetadata.outputs.tags }} | |
- | |
name: Run Tests | |
run: cd endToEndTests && SILO_URL=localhost:8080 npm run test |