Skip to content

Commit 7966f3e

Browse files
authored
Migrate azp pipeline to GitHub actions (#776)
* pin black * migrate azp to gh actions * update secret * disable black
1 parent 0873f87 commit 7966f3e

File tree

5 files changed

+88
-79
lines changed

5 files changed

+88
-79
lines changed

.azure-pipelines/integration_tests.yml

-30
This file was deleted.

.azure-pipelines/unit_tests.yml

-48
This file was deleted.

.github/workflows/test.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,39 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
lint:
17+
name: Lint datadopy files
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Set up Python 3.8
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.8"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install pre-commit
30+
python -m pip install tox
31+
32+
# - name: Run black
33+
# run: pre-commit run --all-files --hook-stage=manual black
34+
35+
- name: Run mypy
36+
run: tox -e mypy
37+
38+
- name: Run flake8
39+
run: tox -e flake8
40+
1641
run:
1742
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
1843
runs-on: ${{ matrix.os }}
1944
strategy:
2045
fail-fast: false
2146
matrix:
2247
os: [ubuntu-latest]
23-
python-version: ['pypy2.7', 'pypy3.8']
48+
python-version: ['pypy2.7', '3.7', 'pypy3.8']
2449
# os: [ubuntu-latest, windows-latest, macos-latest]
2550
# python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy-2.7', 'pypy-3.8']
2651

@@ -38,6 +63,9 @@ jobs:
3863
- name: Install tox
3964
run: pip install tox
4065

66+
- name: Install tox
67+
run: pip install tox
68+
4169
- name: Run unit tests
4270
run: tox
4371

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run Integration Tests
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
types:
6+
- labeled
7+
- unlabeled
8+
- opened
9+
- synchronize
10+
- reopened
11+
- ready_for_review
12+
13+
concurrency:
14+
group: integration-${{ github.head_ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
integration_tests:
19+
runs-on: ubuntu-latest
20+
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci/integrations')
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Set up Python 3.7
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.7"
29+
cache: "pip"
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install tox
35+
36+
- name: Run integration tests
37+
run: tox -e integration -- --vcr-record=all
38+
env:
39+
DD_TEST_CLIENT_API_KEY: "${{ secrets.DD_TEST_CLIENT_API_KEY }}"
40+
DD_TEST_CLIENT_APP_KEY: "${{ secrets.DD_TEST_CLIENT_APP_KEY }}"
41+
DD_TEST_CLIENT_USER: "${{ secrets.DD_TEST_CLIENT_USER }}"
42+
43+
- name: Run admin integration tests
44+
run: tox -e integration-admin -- --vcr-record=all
45+
env:
46+
DD_TEST_CLIENT_API_KEY: ${{ secrets.DD_TEST_CLIENT_API_KEY }}
47+
DD_TEST_CLIENT_APP_KEY: ${{ secrets.DD_TEST_CLIENT_APP_KEY }}
48+
DD_TEST_CLIENT_USER: ${{ secrets.DD_TEST_CLIENT_USER }}

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: black
5+
name: format with black
6+
language: python
7+
entry: tox -e black
8+
stages: [manual]
9+
pass_filenames: false
10+
additional_dependencies:
11+
- "tox"

0 commit comments

Comments
 (0)