Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
name: Main Branch Tests
|
|
on:
|
|
push:
|
|
branch:
|
|
- main
|
|
jobs:
|
|
metadata:
|
|
runs-on: ubuntu-latest
|
|
name: Metadata
|
|
outputs:
|
|
version: ${{ steps.version.outputs.VERSION }}
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Get Version
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
echo ::set-output name=VERSION::$(git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
|
|
- name: ${{ steps.version.outputs.VERSION }}
|
|
shell: bash
|
|
run: |
|
|
echo ${{ steps.version.outputs.VERSION }}
|
|
|
|
python:
|
|
name: "Python Tests"
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- metadata
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- lint
|
|
- coverage
|
|
- security-checks
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install Dependencies
|
|
run: cd api && make setup
|
|
- name: Echo dependencies
|
|
run: cd api && ./venv/bin/pip freeze
|
|
- name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }}
|
|
run: cd api && make ${{ matrix.action }}
|
|
|
|
nodejs:
|
|
name: "NodeJs Tests"
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- metadata
|
|
strategy:
|
|
matrix:
|
|
action:
|
|
- "test:ci"
|
|
- "tsc:ci"
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache: "yarn"
|
|
cache-dependency-path: webapp/yarn.lock
|
|
- name: Install Dependencies
|
|
run: cd webapp && yarn install
|
|
- name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }}
|
|
run: cd webapp && yarn ${{ matrix.action }}
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Build & Publish ${{ matrix.arch }}
|
|
needs:
|
|
- metadata
|
|
- nodejs
|
|
- python
|
|
strategy:
|
|
matrix:
|
|
arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v2.0.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build & Push to Dockerhub - ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }}
|
|
uses: home-assistant/builder@2022.06.2
|
|
with:
|
|
args: |
|
|
--${{ matrix.arch }} \
|
|
--no-latest \
|
|
--version ${{ needs.metadata.outputs.version }} \
|
|
--target .
|