-
Notifications
You must be signed in to change notification settings - Fork 32
99 lines (88 loc) · 4.06 KB
/
Docker Test.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: Docker Test
on:
workflow_run:
workflows:
- "Publish to Azure Artifacts"
types:
- completed
branches: [main, 'b-v*-patch*','feature-*']
pull_request:
branches: [main, 'b-v*-patch*','feature-*']
paths:
- "Docker/**/*"
workflow_dispatch:
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CURRENT_STANDARD_VERSION: "5.1.0"
PACKAGE_VERSION: "7.3"
jobs:
docker-lint:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- ods-api-bulk-load-console/alpine
- ods-api-db-admin/alpine/pgsql
- ods-api-db-ods-minimal/alpine/pgsql
- ods-api-db-ods-sandbox/alpine/pgsql
- ods-api-swaggerui/alpine
- ods-api-web-api/alpine/mssql
- ods-api-web-api/alpine/pgsql
- ods-api-web-sandbox-admin/alpine/mssql
- ods-api-web-sandbox-admin/alpine/pgsql
- ods-api-db-admin/ubuntu/mssql
- ods-api-db-ods-minimal/ubuntu/mssql
- ods-api-db-ods-sandbox/ubuntu/mssql
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
name: Run Linter on Local Dockerfile
with:
dockerfile: Docker/${{ matrix.image }}/Dockerfile
FindStandardAndExtensionVersions:
uses: Ed-Fi-Alliance-OSS/Ed-Fi-ODS/.github/workflows/Find Standard and Extension Versions.yml@874b608a0f3a14243e0035dd1222169fafcbe8d3
with:
calling_branch: ${{ github.head_ref || github.ref_name }}
docker-build:
needs: FindStandardAndExtensionVersions
runs-on: ubuntu-latest
strategy:
matrix:
StandardVersion: ${{ fromJson(needs.FindStandardAndExtensionVersions.outputs.StandardVersions) }}
ExtensionVersion: ${{ fromJson(needs.FindStandardAndExtensionVersions.outputs.ExtensionVersions) }}
dockerfile:
[
{ name: "ods-api-bulk-load-console", path: "alpine" },
{ name: "ods-api-db-admin", path: "alpine/pgsql" },
{ name: "ods-api-db-ods-minimal", path: "alpine/pgsql" },
{ name: "ods-api-db-ods-sandbox", path: "alpine/pgsql" },
{ name: "ods-api-swaggerui", path: "alpine" },
{ name: "ods-api-web-api", path: "alpine/pgsql" },
{ name: "ods-api-web-api", path: "alpine/mssql" },
{ name: "ods-api-web-sandbox-admin", path: "alpine/pgsql" },
{ name: "ods-api-web-sandbox-admin", path: "alpine/mssql" },
{ name: "ods-api-db-admin", path: "ubuntu/mssql" },
{ name: "ods-api-db-ods-minimal", path: "ubuntu/mssql" },
{ name: "ods-api-db-ods-sandbox", path: "ubuntu/mssql" }
]
name: ${{ matrix.dockerfile.name }}/${{ matrix.dockerfile.path }} Image for (Standard ${{ matrix.StandardVersion }} Extension ${{ matrix.ExtensionVersion }})
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Build ${{ matrix.dockerfile.name }} image in path ${{ matrix.dockerfile.path }}
# To confirm no errors occur. The "local" one will be built by the e2e
# testing process.
run: |
./get-versions.ps1 -PackageVersion ${{ env.PACKAGE_VERSION }} -StandardVersion ${{ matrix.StandardVersion }} -ExtensionVersion ${{ matrix.ExtensionVersion }} -PreRelease
./Invoke-Build.ps1 -PackageVersion ${{ env.PACKAGE_VERSION }} -PreRelease -ImageName ${{ matrix.dockerfile.name }} -Path ${{ matrix.dockerfile.path }}
working-directory: Docker
shell: pwsh