Skip to content

Commit

Permalink
Migrate azp pipeline to GitHub actions (#776)
Browse files Browse the repository at this point in the history
* pin black

* migrate azp to gh actions

* update secret

* disable black
  • Loading branch information
skarimo authored Jun 5, 2023
1 parent 0873f87 commit 7966f3e
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 79 deletions.
30 changes: 0 additions & 30 deletions .azure-pipelines/integration_tests.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .azure-pipelines/unit_tests.yml

This file was deleted.

30 changes: 29 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,39 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
name: Lint datadopy files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install pre-commit
python -m pip install tox
# - name: Run black
# run: pre-commit run --all-files --hook-stage=manual black

- name: Run mypy
run: tox -e mypy

- name: Run flake8
run: tox -e flake8

run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['pypy2.7', 'pypy3.8']
python-version: ['pypy2.7', '3.7', 'pypy3.8']
# os: [ubuntu-latest, windows-latest, macos-latest]
# python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy-2.7', 'pypy-3.8']

Expand All @@ -38,6 +63,9 @@ jobs:
- name: Install tox
run: pip install tox

- name: Install tox
run: pip install tox

- name: Run unit tests
run: tox

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Integration Tests

on: # yamllint disable-line rule:truthy
pull_request:
types:
- labeled
- unlabeled
- opened
- synchronize
- reopened
- ready_for_review

concurrency:
group: integration-${{ github.head_ref }}
cancel-in-progress: true

jobs:
integration_tests:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci/integrations')
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: "3.7"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run integration tests
run: tox -e integration -- --vcr-record=all
env:
DD_TEST_CLIENT_API_KEY: "${{ secrets.DD_TEST_CLIENT_API_KEY }}"
DD_TEST_CLIENT_APP_KEY: "${{ secrets.DD_TEST_CLIENT_APP_KEY }}"
DD_TEST_CLIENT_USER: "${{ secrets.DD_TEST_CLIENT_USER }}"

- name: Run admin integration tests
run: tox -e integration-admin -- --vcr-record=all
env:
DD_TEST_CLIENT_API_KEY: ${{ secrets.DD_TEST_CLIENT_API_KEY }}
DD_TEST_CLIENT_APP_KEY: ${{ secrets.DD_TEST_CLIENT_APP_KEY }}
DD_TEST_CLIENT_USER: ${{ secrets.DD_TEST_CLIENT_USER }}
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: local
hooks:
- id: black
name: format with black
language: python
entry: tox -e black
stages: [manual]
pass_filenames: false
additional_dependencies:
- "tox"

0 comments on commit 7966f3e

Please sign in to comment.