Skip to content

ci [N/A]

ci [N/A] #125

Workflow file for this run

name: ci
run-name: ci [${{ inputs.uuid && inputs.uuid || 'N/A' }}]
on:
push:
workflow_dispatch:
inputs:
uuid:
description: 'Unique ID'
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Define global variables
id: global_variables
run: |
echo "BRANCH_NAME=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "CONTAINER_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Api
env:
CONTAINER_ID: ${{ steps.global_variables.outputs.CONTAINER_ID }}
uses: docker/build-push-action@v6
with:
build-args: |
ADMIN_PASSWORD=dummy_password
API_PORT=5005
context: .
file: Containerfile-api
push: false
no-cache: true
tags: basil-api_${{ env.CONTAINER_ID }}
outputs: type=docker,dest=/tmp/basil-api_${{ env.CONTAINER_ID }}.tar
- name: Build App
env:
CONTAINER_ID: ${{ steps.global_variables.outputs.CONTAINER_ID }}
uses: docker/build-push-action@v6
with:
build-args: |
API_ENDPOINT=http://localhost:5005
APP_PORT=9056
context: .
file: Containerfile-app
push: false
no-cache: true
tags: basil-app_${{ env.CONTAINER_ID }}
outputs: type=docker,dest=/tmp/basil-app_${{ env.CONTAINER_ID }}.tar
- name: Upload basil-api artifact
env:
CONTAINER_ID: ${{ steps.global_variables.outputs.CONTAINER_ID }}
uses: actions/upload-artifact@v4
with:
name: basil-api
path: /tmp/basil-api_${{ env.CONTAINER_ID }}.tar
- name: Upload basil-app artifact
env:
CONTAINER_ID: ${{ steps.global_variables.outputs.CONTAINER_ID }}
uses: actions/upload-artifact@v4
with:
name: basil-app
path: /tmp/basil-app_${{ env.CONTAINER_ID }}.tar
test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Define global variables
id: global_variables
run: |
echo "BRANCH_NAME=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "CONTAINER_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
- name: Download basil-api artifacts
uses: actions/download-artifact@v4
with:
name: basil-api
path: /tmp
- name: Download basil-app artifacts
uses: actions/download-artifact@v4
with:
name: basil-app
path: /tmp
- name: Load images
env:
CONTAINER_ID: ${{ steps.global_variables.outputs.CONTAINER_ID }}
run: |
docker load --input /tmp/basil-api_${{ env.CONTAINER_ID }}.tar
docker load --input /tmp/basil-app_${{ env.CONTAINER_ID }}.tar
docker image ls -a
docker run -d --network=host basil-api_${{ env.CONTAINER_ID }}
docker run -d --network=host basil-app_${{ env.CONTAINER_ID }}
sleep 60
docker ps
echo "Test Api is running"
curl -vf http://localhost:5005/version
echo "Test App is running"
curl -vf http://localhost:9056
- name: Cypress E2E Testing
uses: cypress-io/github-action@v6
with:
browser: chrome
spec: cypress/e2e/login.cy.js
env:
LIBGL_ALWAYS_SOFTWARE: 1