Skip to content

Commit

Permalink
Refactoring after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Mar 8, 2024
1 parent 5f9b52b commit db35a15
Show file tree
Hide file tree
Showing 162 changed files with 52,712 additions and 2,385 deletions.
8 changes: 1 addition & 7 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
[flake8]
max-line-length = 120
exclude =
.git,
__pycache__,
.venv,
# Ignore generated *_pb2.py files
gen_proto, *_pb2*
max_line_length = 120
4 changes: 1 addition & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* for sub components like hvac_service and seat_service use pattern:
**\<subcomponent>_\<action> eg: hvac_service**

* for overall tasks use pattern:
**\<action> eg: release**

## Naming of Tags

Expand All @@ -29,6 +27,6 @@ In general the naming shall follow: **<type>(_<sub-type>)_<componenent-name>.tar

## How to create a new release

See [Release Process](https://github.com/eclipse/kuksa.val.services/wiki/Release-Process)
See [Release Process](https://github.com/eclipse-kuksa/kuksa-incubation/wiki/Release-Process)


34 changes: 34 additions & 0 deletions .github/workflows/check_license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: spdx

on:
pull_request

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}

Check failure on line 7 in .github/workflows/check_license.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

7:7 [indentation] wrong indentation: expected 2 but found 6
cancel-in-progress: true

jobs:
check-spdx-headers:
runs-on: ubuntu-latest

steps:

- name: Checkout code

Check failure on line 16 in .github/workflows/check_license.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

16:5 [indentation] wrong indentation: expected 6 but found 4
uses: actions/checkout@v4
with:
# required to grab the history of the PR
fetch-depth: 0
submodules: 'true'

- name: Get changed files
run: |
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | tr '\n' ',')" >> $GITHUB_ENV
- name: Set license
run: |
echo "licenses=Apache-2.0" >> $GITHUB_ENV
- uses: eclipse-kuksa/kuksa-actions/spdx@2
with:
files: "${{ env.files }}"
licenses: "${{ env.licenses }}"
130 changes: 0 additions & 130 deletions .github/workflows/dev_container_build.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/hvac_integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: hvac-integration-test

on:
workflow_dispatch:
push:
# Run only on branches/commits and not tags
branches:
- main
pull_request:
paths:
- ".github/workflows/hvac_integration_test.yml"
- "hvac_service/**"
- "proto/**"

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
integration-test:
runs-on: ubuntu-latest

steps:
- name: Adding github workspace as safe directory
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global user.email "[email protected]"
git config --global user.name "Github Automation"
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install dependencies
shell: bash
run: |
.github/workflows/scripts/hvac-install-ci-tooling.sh
- name: Build hvac_service image
shell: bash
working-directory: ./hvac_service
run: |
./docker-build.sh -l x86_64
- name: Setup VAL containers
shell: bash
env:
# We may need to specify a VSS version compatible with the code in this repository
# This is needed if the default VSS version used by Databroker has backward incompatible changes
# affecting integration tests for this repository
# The file specified must exist in the Databroker container
# KDB_OPT: "--vss vss_release_3.1.1.json"
HVAC_TAG: "prerelease"
run: |
./hvac_service/integration_test/it-setup.sh init
if ! ./hvac_service/integration_test/it-setup.sh start; then
echo "### Container startup failed logs:"
./hvac_service/integration_test/it-setup.sh status --logs
exit 1
fi
sleep 1
./hvac_service/integration_test/it-setup.sh status --logs
# echo "$ docker image ls"
# docker image ls
# echo "$ docker ps -a"
# docker ps -a
# echo "$ docker inspect val-int"
# docker inspect val-int
- name: Install Requirements
shell: bash
run: |
pip3 install -U -r hvac_service/integration_test/requirements.txt
pip3 install -U -e hvac_service/
pip3 install -U -e hvac_service/integration_test/
- name: Run Integration Tests
shell: bash
env:
# force using it-setup.sh (testing with ghcr.io tags), DAPR standalone mode does not work in CI
USE_DAPR: "0"
GRPC_ENABLE_FORK_SUPPORT: "false"
run: |
pytest -v ./hvac_service/integration_test --asyncio-mode=auto \
--override-ini junit_family=xunit1 --junit-xml=./results/IntegrationTest/junit.xml \
--log-file=./results/IntegrationTest/integration.log --log-file-level=DEBUG
# Step below disabled, only triggered for pull requests internally within repository
# and that is typically not used, and is not working as action does not have sufficient permissions
# - name: Publish Integration Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
# with:
# files: ./results/IntegrationTest/junit.xml

- name: Upload Integration Test Logs
uses: actions/upload-artifact@v4
if: always()
with:
name: integration_test.log
path: |
./results/IntegrationTest/integration.log
- name: Integration logs and cleanup
shell: bash
run: |
./hvac_service/integration_test/it-setup.sh status --logs
./hvac_service/integration_test/it-setup.sh cleanup --force
docker image ls
docker ps -a
12 changes: 8 additions & 4 deletions .github/workflows/hvac_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

# Needed as default_workflow_permissions is "read"
permissions:
packages: write

jobs:

check_ghcr_push:
Expand Down Expand Up @@ -69,7 +73,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/eclipse/kuksa.val.services/hvac_service
ghcr.io/eclipse-kuksa/kuksa-incubation/hvac_service
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
Expand Down Expand Up @@ -105,7 +109,7 @@ jobs:
push: true
tags: |
${{ steps.meta.outputs.tags }}
ttl.sh/kuksa.val.services/hvac_service-${{github.sha}}
ttl.sh/eclipse-kuksa/kuksa-incubation/hvac_service-${{github.sha}}
labels: ${{ steps.meta.outputs.labels }}

- name: Build container and push to ttl.sh
Expand All @@ -119,10 +123,10 @@ jobs:
file: ./hvac_service/Dockerfile
context: ./hvac_service
push: true
tags: "ttl.sh/kuksa.val.services/hvac_service-${{github.sha}}"
tags: "ttl.sh/eclipse-kuksa/kuksa-incubation/hvac_service-${{github.sha}}"
labels: ${{ steps.meta.outputs.labels }}

- name: Posting message
uses: eclipse-kuksa/kuksa-actions/post-container-location@2
with:
image: ttl.sh/kuksa.val.services/hvac_service-${{github.sha}}
image: ttl.sh/eclipse-kuksa/kuksa-incubation/hvac_service-${{github.sha}}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
# Upload MegaLinter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
Expand Down
Loading

0 comments on commit db35a15

Please sign in to comment.