Skip to content

Commit

Permalink
Merge 2c38d22 into 786e7d0
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed Jan 13, 2022
2 parents 786e7d0 + 2c38d22 commit cc891d3
Show file tree
Hide file tree
Showing 491 changed files with 9,823 additions and 21,294 deletions.
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ ENV TZ=Europe/Stockholm
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=noninteractive
ENV TEST=AK

# dotnet specific
ENV ASPNETCORE_ENVIRONMENT="Development"
ENV DOTNET_ENVIRONMENT="Development"
49 changes: 49 additions & 0 deletions .github/workflows/ci_app_model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#### Build and tests all pushes, also code coverage
name: 🛠️ CI build app model (temporary)
on:
push:
branches:
- app_model
pull_request:
branches:
- app_model
jobs:
build:
name: 🔨 Build sources (CI)
runs-on: ubuntu-latest
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main

- name: 🥅 Install .Net 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x" # SDK Version

- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"

- name: 🛠️ Build code
run: dotnet build /warnaserror

- name: 👀 Test
run: |
dotnet test src/HassModel/NetDaemon.HassModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Extensions/NetDaemon.Extensions.Scheduling.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Client/NetDaemon.HassClient.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Runtime/NetDaemon.Runtime.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/AppModel/NetDaemon.AppModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
- name: 📨 Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{github.workspace}}/codecover.info

- name: 📨 Publish coverage to codecov
uses: codecov/codecov-action@v2
with:
flags: unittests # optional
name: codecov-umbrella # optional
files: ${{github.workspace}}/codecover.info
fail_ci_if_error: true # optional (default = false)
6 changes: 3 additions & 3 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:

- name: 👀 Test
run: |
dotnet test tests/NetDaemon.Daemon.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/HassModel/NetDaemon.HassModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Extensions/NetDaemon.Extensions.Scheduling.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Client/NetDaemon.HassClient.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Extensions/NetDaemon.Extensions.Scheduling.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/Client/NetDaemon.HassClient.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
dotnet test src/AppModel/NetDaemon.AppModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover
- name: 📨 Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
Expand Down
86 changes: 0 additions & 86 deletions .github/workflows/ci_integration_tests.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/push_docker_addon_manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#### Publish tags to docker hub
name: 📦 Deploy to Docker add-on with tag
on:
workflow_dispatch:
inputs:
tag:
description: "Enter docker image tag"
required: true
default: "branch"

jobs:
deploy:
name: 📦 Deploy to Docker add-on with tag
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
sed -i '/ private const string Version = /c\ private const string Version = "feature build";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature" \\' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: 🔓 Login to Docker hub
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: 🔓 Login to GitHub Container Registry
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Run Buildx
run: |
docker buildx build \
--platform linux/arm,linux/arm64,linux/amd64 \
--output "type=image,push=true" \
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon3:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon3:feature-${{ github.event.inputs.tag }}"
74 changes: 57 additions & 17 deletions .github/workflows/push_docker_dev.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,79 @@
#### Publish tags to docker hub
name: 📦 Deploy dev docker
name: 📦 Deploy dev and appmodel docker
on:
push:
branches:
push:
branches:
- dev
- app_model

jobs:
deploy:
deploy_docker_addon_dev:
name: 📦 Deploy to Docker add-on dev
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
sed -i '/ private const string Version = /c\ private const string Version = "dev";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="dev" \\' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: 🔓 Login to Docker hub
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: 🔓 Login to GitHub Container Registry
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🛠️ Run Buildx
run: |
docker buildx build \
--platform linux/arm,linux/arm64,linux/amd64 \
--output "type=image,push=true" \
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag netdaemon/netdaemon_addon3:dev \
--tag ghcr.io/net-daemon/netdaemon_addon3:dev
deploy_docker_dev:
name: 📦 Deploy to Docker dev
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
sed -i '/ private const string Version = /c\ private const string Version = "dev build";' ${{github.workspace}}/src/DaemonRunner/DaemonRunner/Service/RunnerService.cs
sed -i '/ io.hass.version=/c\ io.hass.version="dev" \\' ${{github.workspace}}/Dockerfile
-
name: 📎 Set up QEMU
sed -i '/ private const string Version = /c\ private const string Version = "dev";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: 🔧 Set up Docker Buildx
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: 🧰 Available platforms
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: 🔓 Login to Docker hub
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: 🔓 Login to GitHub Container Registry
uses: docker/login-action@v1.10.0
with:
Expand All @@ -49,5 +89,5 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag netdaemon/netdaemon:dev \
--tag ghcr.io/net-daemon/netdaemon:dev
--tag netdaemon/netdaemon3:dev \
--tag ghcr.io/net-daemon/netdaemon3:dev
50 changes: 45 additions & 5 deletions .github/workflows/push_docker_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: "branch"

jobs:
deploy:
deploy_docker:
name: 📦 Deploy to Docker with tag
runs-on: ubuntu-latest
environment: CI - release environment
Expand All @@ -18,8 +18,8 @@ jobs:
uses: actions/checkout@main
- name: 📆 Set version number
run: |
sed -i '/ private const string Version = /c\ private const string Version = "feature build";' ${{github.workspace}}/src/DaemonRunner/DaemonRunner/Service/RunnerService.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature" \\' ${{github.workspace}}/Dockerfile
sed -i '/ private const string Version = /c\ private const string Version = "feature-${{ github.event.inputs.tag }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature-${{ github.event.inputs.tag }}" \\' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
Expand Down Expand Up @@ -47,5 +47,45 @@ jobs:
--no-cache \
--file ./Dockerfile . \
--compress \
--tag "netdaemon/netdaemon:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon:feature-${{ github.event.inputs.tag }}"
--tag "netdaemon/netdaemon3:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon3:feature-${{ github.event.inputs.tag }}"
deploy_docker_addon:
name: 📦 Deploy to Docker add-on with tag
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
sed -i '/ private const string Version = /c\ private const string Version = "dev";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="dev" \\' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: 🔓 Login to Docker hub
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: 🔓 Login to GitHub Container Registry
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Run Buildx
run: |
docker buildx build \
--platform linux/arm,linux/arm64,linux/amd64 \
--output "type=image,push=true" \
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon_addon3:feature-${{ github.event.inputs.tag }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon3:feature-${{ github.event.inputs.tag }}"
Loading

0 comments on commit cc891d3

Please sign in to comment.