Skip to content

Commit 1353f58

Browse files
author
Victoria Hall
committed
basic 1ES pipeline
1 parent d9eacfa commit 1353f58

File tree

1 file changed

+23
-159
lines changed

1 file changed

+23
-159
lines changed

.github/workflows/ci_e2e_workflow.yml

+23-159
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,23 @@
33

44
name: CI E2E tests
55

6+
resources:
7+
repositories:
8+
- repository: 1es
9+
type: git
10+
name: 1ESPipelineTemplates/1ESPipelineTemplates
11+
ref: refs/tags/release
12+
613
on:
7-
workflow_dispatch:
8-
inputs:
9-
archive_webhost_logging:
10-
description: "For debugging purposes, archive test webhost logs"
11-
required: false
12-
default: "false"
1314
push:
1415
branches: [dev, main, release/*]
1516
pull_request:
1617
branches: [dev, main, release/*]
1718
schedule:
1819
# Monday to Friday 3 AM CST build
19-
# * is a special character in YAML, so you have to quote this string
20+
# * is a special character in YAML so you have to quote this string
2021
- cron: "0 8 * * 1,2,3,4,5"
2122

22-
resources:
23-
repositories:
24-
- repository: 1es
25-
type: git
26-
name: 1ESPipelineTemplates/1ESPipelineTemplates
27-
ref: refs/tags/release
2823
extends:
2924
template: v1/1ES.Official.PipelineTemplate.yml@1es
3025
parameters:
@@ -34,149 +29,18 @@ extends:
3429
os: windows
3530

3631
stages:
37-
- stage: Build
38-
displayName: 'Build using 1ES Pool'
39-
jobs:
40-
- job: Build
41-
pool:
42-
name: 1es-pool-azfunc
43-
image: 1es-ubuntu-22.04
44-
os: linux
45-
steps:
46-
- name: "Python E2E CI Run"
47-
runs-on: ubuntu-latest
48-
strategy:
49-
fail-fast: false
50-
matrix:
51-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
52-
# Currently runs FWPC E2E tests, classic E2E tests, and DefBindings E2E tests.
53-
# To run tests from another script, add the script name to this matrix
54-
test-type: [fwpc-e2e-tests, e2e-tests, deferred-bindings-e2e-tests]
55-
permissions: read-all
56-
- name: Checkout code.
57-
uses: actions/checkout@v4
58-
- name: Set up Python ${{ matrix.python-version }}
59-
uses: actions/setup-python@v5
60-
with:
61-
python-version: ${{ matrix.python-version }}
62-
- name: Set up Dotnet 8.0.x
63-
uses: actions/setup-dotnet@v4
64-
with:
65-
dotnet-version: "8.0.x"
66-
- name: Install dependencies and the worker
67-
run: |
68-
retry() {
69-
local -r -i max_attempts="$1"; shift
70-
local -r cmd="$@"
71-
local -i attempt_num=1
72-
until $cmd
73-
do
74-
if (( attempt_num == max_attempts ))
75-
then
76-
echo "Attempt $attempt_num failed and there are no more attempts left!"
77-
return 1
78-
else
79-
echo "Attempt $attempt_num failed! Trying again in $attempt_num seconds..."
80-
sleep 1
81-
fi
82-
done
83-
}
84-
85-
python -m pip install --upgrade pip
86-
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre
87-
python -m pip install -U -e .[dev]
88-
89-
if [[ "${{ matrix.python-version }}" != "3.7" ]]; then
90-
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre -U -e .[test-http-v2]
91-
fi
92-
if [[ "${{ matrix.python-version }}" != "3.7" && "${{ matrix.python-version }}" != "3.8" ]]; then
93-
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre -U -e .[test-deferred-bindings]
94-
fi
95-
96-
# Retry a couple times to avoid certificate issue
97-
retry 5 python setup.py build
98-
retry 5 python setup.py webhost --branch-name=dev
99-
retry 5 python setup.py extension
100-
mkdir logs
101-
- name: Grant execute permission
102-
run: |
103-
chmod +x .github/Scripts/${{ matrix.test-type }}.sh
104-
- name: Running 3.7 ${{ matrix.test-type }}
105-
if: matrix.python-version == 3.7
106-
env:
107-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
108-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString37 }}
109-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString37 }}
110-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString37 }}
111-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString37 }}
112-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }}
113-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }}
114-
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
115-
run: |
116-
.github/Scripts/${{ matrix.test-type }}.sh
117-
- name: Running 3.8 ${{ matrix.test-type }}
118-
if: matrix.python-version == 3.8
119-
env:
120-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
121-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString38 }}
122-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString38 }}
123-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString38 }}
124-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString38 }}
125-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }}
126-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }}
127-
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
128-
run: |
129-
.github/Scripts/${{ matrix.test-type }}.sh
130-
- name: Running 3.9 ${{ matrix.test-type }}
131-
if: matrix.python-version == 3.9
132-
env:
133-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
134-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString39 }}
135-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString39 }}
136-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString39 }}
137-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString39 }}
138-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }}
139-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }}
140-
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
141-
run: |
142-
.github/Scripts/${{ matrix.test-type }}.sh
143-
- name: Running 3.10 ${{ matrix.test-type }}
144-
if: matrix.python-version == 3.10
145-
env:
146-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
147-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString310 }}
148-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString310 }}
149-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString310 }}
150-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString310 }}
151-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }}
152-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }}
153-
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
154-
run: |
155-
.github/Scripts/${{ matrix.test-type }}.sh
156-
- name: Running 3.11 ${{ matrix.test-type }}
157-
if: matrix.python-version == 3.11
158-
env:
159-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
160-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString311 }}
161-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString311 }}
162-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString311 }}
163-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString311 }}
164-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString311 }}
165-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString311 }}
166-
ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }}
167-
run: |
168-
.github/Scripts/${{ matrix.test-type }}.sh
169-
- name: Codecov
170-
uses: codecov/codecov-action@v3
171-
with:
172-
file: ./coverage.xml # optional
173-
flags: unittests # optional
174-
name: codecov # optional
175-
fail_ci_if_error: false # optional (default = false)
176-
- name: Publish Logs to Artifact
177-
if: failure()
178-
uses: actions/upload-artifact@v4
179-
with:
180-
name: Test WebHost Logs ${{ github.run_id }} ${{ matrix.python-version }}
181-
path: logs/*.log
182-
if-no-files-found: ignore
32+
- stage: Build
33+
displayName: 'Python E2E CI Run -- 1ES PT'
34+
jobs:
35+
- job: Build
36+
pool:
37+
name: 1es-pool-azfunc
38+
image: 1es-ubuntu-22.04
39+
os: linux
40+
steps:
41+
- name: Checkout code.
42+
uses: actions/checkout@v4
43+
- name: Set up Dotnet 8.0.x
44+
uses: actions/setup-dotnet@v4
45+
with:
46+
dotnet-version: "8.0.x"

0 commit comments

Comments
 (0)