Skip to content

feat: support for sql reports without date range #5436

feat: support for sql reports without date range

feat: support for sql reports without date range #5436

name: Pipeline
on: pull_request
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Get time of commit
run: echo "TIME=$(git log -1 --pretty=format:%ct)" >> $GITHUB_ENV
- name: Run tests in Docker image
uses: docker/build-push-action@v3
with:
context: ./
file: ./build/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
target: builder
tags: test-image
build-args: |
UPLOAD_COVERAGE=${{ true }}
GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}
GIT_BRANCH=${{ github.head_ref }}
GIT_COMMITTED_AT=${{ env.TIME }}
CC_TEST_REPORTER_ID=${{ secrets.CODE_CLIMATE_ID }}
BUILD=${{ false }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run tests with timezone
uses: docker/build-push-action@v3
if: false # disable additional timezone tests for now
with:
context: ./
file: ./build/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
target: builder
build-args: |
RUN_TESTS=${{ true }}
TZ=America/Detroit
BUILD=${{ false }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy-prod-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push PR image
uses: docker/build-push-action@v5
with:
context: ./
file: ./build/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: aamdigital/ndb-server:pr-${{ github.event.number }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy updated image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /var/docker/pr-${{ github.event.number }}
docker compose pull
docker compose up -d