[Time Series] PR workflow (by @hteeyeoh via push) #14
This file contains hidden or 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
# | |
# Apache v2 license | |
# Copyright (C) 2025 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
name: "[Time Series] PR workflow" | |
run-name: "[Time Series] PR workflow (by @${{ github.actor }} via ${{ github.event_name }})" | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'microservices/time-series-analytics/*' | |
- 'microservices/time-series-analytics/config/**' | |
- 'microservices/time-series-analytics/docker/**' | |
- 'microservices/time-series-analytics/src/**' | |
- 'microservices/time-series-analytics/tests/**' | |
- 'microservices/time-series-analytics/tick_scripts/**' | |
- 'microservices/time-series-analytics/udfs/**' | |
pull_request: | |
paths: | |
- 'microservices/time-series-analytics/*' | |
- 'microservices/time-series-analytics/config/**' | |
- 'microservices/time-series-analytics/docker/**' | |
- 'microservices/time-series-analytics/src/**' | |
- 'microservices/time-series-analytics/tests/**' | |
- 'microservices/time-series-analytics/tick_scripts/**' | |
- 'microservices/time-series-analytics/udfs/**' | |
workflow_call: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: read | |
pull-requests: read | |
security-events: write | |
actions: read | |
jobs: | |
timeseries-pre-merge-build: | |
permissions: | |
contents: read | |
packages: read # needed for actions/checkout | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Runner workspace path | |
run: | | |
echo "Cleaning up previous run" | |
if [ -n "$(docker ps -aq)" ]; then | |
docker stop $(docker ps -aq) | |
fi | |
if [ -n "$(docker ps -aq)" ]; then | |
docker rm $(docker ps -aq) | |
fi | |
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f | |
- uses: actions/checkout@v1 | |
with: | |
path: timeseries | |
persist-credentials: false | |
- name: Build | |
run: | | |
cd ./microservices/time-series-analytics/docker | |
sed -i "s/DOCKER_REGISTRY=.*/DOCKER_REGISTRY=admin/g" .env | |
docker compose down -v | |
docker compose build | |
- name: Deploy | |
run: | | |
cd "${{ github.workspace }}" | |
cd ./microservices/time-series-analytics/docker | |
echo "Deploying time-series-analytics microservices" | |
docker compose up -d | |
- name: Undeploy | |
run: | | |
cd "${{ github.workspace }}" | |
cd ./microservices/time-series-analytics/docker | |
docker compose down -v | |
timeseries-unit-test: | |
uses: ./.github/workflows/timeseries-unit-test.yaml | |
timeseries-function-tests: | |
name: Timeseries function Test | |
uses: ./.github/workflows/timeseries-weekly-functional-tests.yaml | |
with: | |
test_pattern: 'test_docker.py::test_input_endpoint test_docker.py::test_health_check test_helm.py::test_input_endpoint test_helm.py::test_health_check' | |
timeseries-scans: | |
uses: ./.github/workflows/timeseries-scans.yaml | |
with: | |
target: all-scans |