-
Notifications
You must be signed in to change notification settings - Fork 128
83 lines (73 loc) · 2.79 KB
/
aml-benchmark-test.yaml
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
name: aml-benchmark-test
on:
pull_request:
branches:
- main
paths:
- assets/aml-benchmark/**
- .github/workflows/aml-benchmark-test.yaml
workflow_dispatch:
env:
scripts_setup_dir: scripts/setup
conda_env_prefix: /opt/conda/envs/aml_benchmark
aml_benchmark_conda_yaml: assets/aml-benchmark/dev_conda_env.yaml
working_dir: assets/aml-benchmark/components/src
pytest_report_folder: pytest-reports
pytest_report_file: test-result.xml
jobs:
check-execution-context:
uses: Azure/azureml-assets/.github/workflows/check-execution-context.yaml@main
run-tests:
name: Run AML Benchmark Tests
runs-on: ubuntu-latest
needs: check-execution-context
environment: Testing
permissions:
# Required to clone repo
contents: read
# Required for OIDC login to Azure
id-token: write
# Required for EnricoMi/publish-unit-test-result-action
checks: write
issues: read
pull-requests: write
steps:
- name: Clone branch
uses: Azure/azureml-assets/.github/actions/clone-repo@main
with:
forked-pr: ${{ needs.check-execution-context.outputs.forked_pr }}
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: '==3.8'
- name: Create conda env
run: |
set -ex
apt-get update && apt-get upgrade && apt-get install -y build-essential
echo ${{ env.conda_env_prefix }}
conda env create -p ${{ env.conda_env_prefix }} -f ${{ env.aml_benchmark_conda_yaml }} -q
echo "conda env successfully created at ${{ env.conda_env_prefix }}"
conda list -p ${{ env.conda_env_prefix }}
- name: Log in to Azure and create resources
uses: ./.github/actions/create-azure-resources
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
scripts-setup-dir: ${{ env.scripts_setup_dir }}
- name: Execute tests
run: |
cd ${{ env.working_dir }}
pwd
conda run -p ${{ env.conda_env_prefix }} python -m pytest ../../tests --junitxml=${{ env.pytest_report_folder }}/${{ env.pytest_report_file }} --tb=native -o log_level=DEBUG -n 8
env:
SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
RESOURCE_GROUP: ${{ env.resource_group }}
WORKSPACE_NAME: ${{ env.workspace }}
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Test Results for ${{ github.workflow }}
junit_files: ${{ env.working_dir }}/${{ env.pytest_report_folder }}/**/*.xml