-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (42 loc) · 2.22 KB
/
PR.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Main Branch PR
on:
pull_request:
branches:
- main
jobs:
Build-Code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore iotedge/Distributed.IoT.Edge
- name: Build
run: dotnet build iotedge/Distributed.IoT.Edge --no-restore
- name: Test
run: dotnet test iotedge/Distributed.IoT.Edge --no-build --verbosity normal
- name: Build Dockerfile for OpcUa.Publisher module
id: dockerfileOpcUaPublisher
shell: pwsh
run: |
$definition = & ./deployment/build-opcuapublisher-dockerfile.ps1 -Path ./lib/Industrial-IoT/modules/src/Microsoft.Azure.IIoT.Modules.OpcUa.Publisher/src
$dockerfile = $definition.dockerfile
$contentPath = (Join-Path $definition.buildContext /.)
echo "DOCKERFILE=$dockerfile" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "CONTENTPATH=$contentPath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Get the version
id: vars
run: echo tag=$(echo main-pr-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")) >> "$GITHUB_OUTPUT"
- name: echo tag
run: echo ${{steps.vars.outputs.tag}}
- name: Build the tagged Docker image for Data Gateway module.
run: docker build iotedge/Distributed.IoT.Edge/. --file iotedge/Distributed.IoT.Edge/Distributed.IoT.Edge.DataGatewayModule/Dockerfile --tag azure-samples/distributed-az-iot-edge-datagatewaymodule:${{steps.vars.outputs.tag}}
- name: Build the tagged Docker image for Simulated Temperature Sensor module.
run: docker build iotedge/Distributed.IoT.Edge/. --file iotedge/Distributed.IoT.Edge/Distributed.IoT.Edge.SimulatedTemperatureSensorModule/Dockerfile --tag azure-samples/distributed-az-iot-edge-simulatedtemperaturesensormodule:${{steps.vars.outputs.tag}}
- name: Build the tagged Docker image for OpcUa.Publisher module.
run: docker build ${{ env.CONTENTPATH }} --file ${{ env.DOCKERFILE }} --tag azure-samples/distributed-az-iot-edge-opcuapublisher:${{steps.vars.outputs.tag}}