Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions .github/workflows/dependency-wheel-promotion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ jobs:
- name: Checkout trusted code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Find existing lifecycle comment
id: find_comment
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
with:
issue-number: ${{ inputs.pr_number }}
body-includes: "<!-- dependency-wheel-promotion pr=${{ inputs.pr_number }} sha=${{ inputs.head_sha }} -->"

- name: Post lifecycle comment (started)
id: started_comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
issue-number: ${{ inputs.pr_number }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
edit-mode: replace
body: |
<!-- dependency-wheel-promotion pr=${{ inputs.pr_number }} sha=${{ inputs.head_sha }} -->
Wheel promotion started for commit `${{ inputs.head_sha }}` by @${{ github.actor }}.
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

- name: Checkout PR lockfiles only
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down Expand Up @@ -62,41 +81,57 @@ jobs:

- name: Set dependency-wheel-promotion status to success
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
HEAD_SHA: ${{ inputs.head_sha }}
with:
script: |
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: '${{ inputs.head_sha }}',
sha: process.env.HEAD_SHA,
state: 'success',
context: 'dependency-wheel-promotion',
description: 'Wheels promoted to stable storage.',
target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
});

- name: Post success comment
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- name: Update lifecycle comment (success)
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
script: |
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ inputs.pr_number }},
body: `Wheels promoted to stable storage for commit ${{ inputs.head_sha }} by @${context.actor}. [Workflow run](${runUrl}).`,
});
issue-number: ${{ inputs.pr_number }}
comment-id: ${{ steps.started_comment.outputs.comment-id }}
edit-mode: replace
body: |
<!-- dependency-wheel-promotion pr=${{ inputs.pr_number }} sha=${{ inputs.head_sha }} -->
Wheels promoted to stable storage for commit `${{ inputs.head_sha }}` by @${{ github.actor }}.
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

- name: Set dependency-wheel-promotion status to error
if: failure()
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
HEAD_SHA: ${{ inputs.head_sha }}
with:
script: |
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: '${{ inputs.head_sha }}',
sha: process.env.HEAD_SHA,
state: 'error',
context: 'dependency-wheel-promotion',
description: 'Wheel promotion failed. Check the Actions tab for details.',
target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
});

- name: Update lifecycle comment (failure)
if: failure()
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
issue-number: ${{ inputs.pr_number }}
comment-id: ${{ steps.started_comment.outputs.comment-id }}
edit-mode: replace
body: |
<!-- dependency-wheel-promotion pr=${{ inputs.pr_number }} sha=${{ inputs.head_sha }} -->
Wheel promotion failed for commit `${{ inputs.head_sha }}` by @${{ github.actor }}.
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Check the workflow logs before retrying.
2 changes: 1 addition & 1 deletion .github/workflows/master-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Upload coverage to Datadog
if: always()
continue-on-error: true
uses: DataDog/coverage-upload-github-action@9bbbf86d16f7db1b14c5b885e61cf0d96053686a # v1.0.0
uses: DataDog/coverage-upload-github-action@6c4bd935248daa6f0ef94e3e6ba71ad5ad079998 # v1.0.3
with:
api_key: ${{ secrets.DD_API_KEY }}
files: coverage-reports
Expand Down
88 changes: 44 additions & 44 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ name: Master
on:
push:
branches:
- master
- master
paths:
# List of files/paths that should trigger the run. The intention is to avoid running all tests if the commit only includes changes on assets or README
- '*/datadog_checks/**'
- '*/tests/**'
- 'ddev/**'
- 'datadog_checks_base/**'
- 'datadog_checks_dev/**'
# Contains overrides for testing
- '.ddev/**'
# Want to ensure any change in workflows is validated
- '.github/workflows/**'
# Test matrices and dependencies
- '*/hatch.toml'
- '*/pyproject.toml'
# Some integrations might use this file to validate metrics emission
- '*/metadata.csv'
# In case some linting formatting config has changed
- 'pyproject.toml'
- "*/datadog_checks/**"
- "*/tests/**"
- "ddev/**"
- "datadog_checks_base/**"
- "datadog_checks_dev/**"
# Contains overrides for testing
- ".ddev/**"
# Want to ensure any change in workflows is validated
- ".github/workflows/**"
# Test matrices and dependencies
- "*/hatch.toml"
- "*/pyproject.toml"
# Some integrations might use this file to validate metrics emission
- "*/metadata.csv"
# In case some linting formatting config has changed
- "pyproject.toml"
schedule:
- cron: '0 2 * * *'
- cron: "0 2 * * *"

jobs:
cache:
uses: ./.github/workflows/cache-shared-deps.yml

test:
needs:
- cache
- cache

uses: ./.github/workflows/test-all.yml
with:
Expand All @@ -48,12 +48,12 @@ jobs:
secrets: inherit

permissions:
# needed for compute-matrix in test-target.yml
contents: read
# needed for compute-matrix in test-target.yml
contents: read

publish-test-results:
needs:
- test
- test

if: success() || failure()
concurrency:
Expand All @@ -69,7 +69,7 @@ jobs:

upload-coverage:
needs:
- test
- test
if: >
!github.event.repository.private &&
(success() || failure())
Expand All @@ -80,27 +80,27 @@ jobs:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Download all coverage artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-*
path: coverage-reports
merge-multiple: false
- name: Download all coverage artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-*
path: coverage-reports
merge-multiple: false

- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
use_oidc: true
directory: coverage-reports
fail_ci_if_error: false
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
use_oidc: true
directory: coverage-reports
fail_ci_if_error: false

- name: Upload coverage to Datadog
if: always()
continue-on-error: true
uses: DataDog/coverage-upload-github-action@9bbbf86d16f7db1b14c5b885e61cf0d96053686a # v1.0.0
with:
api_key: ${{ secrets.DD_API_KEY }}
files: coverage-reports
format: cobertura
- name: Upload coverage to Datadog
if: always()
continue-on-error: true
uses: DataDog/coverage-upload-github-action@6c4bd935248daa6f0ef94e3e6ba71ad5ad079998 # v1.0.3
with:
api_key: ${{ secrets.DD_API_KEY }}
files: coverage-reports
format: cobertura
72 changes: 36 additions & 36 deletions .github/workflows/pr-all-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ name: PR All Windows
on:
pull_request:
paths:
- datadog_checks_base/datadog_checks/**
- datadog_checks_dev/datadog_checks/dev/*.py
- ddev/src/**
- "!agent_requirements.in"
# Also run if we modify the workflow files
- '.github/workflows/pr-all-windows.yml'
- '.github/workflows/test-target.yml'
- '.github/workflows/test-all-windows.yml'
# Also run in the action to install test-target scripts changes
- '.github/actions/setup-test-target-scripts/**'
- '.github/actions/setup-ddev/**'
- datadog_checks_base/datadog_checks/**
- datadog_checks_dev/datadog_checks/dev/*.py
- ddev/src/**
- "!agent_requirements.in"
# Also run if we modify the workflow files
- ".github/workflows/pr-all-windows.yml"
- ".github/workflows/test-target.yml"
- ".github/workflows/test-all-windows.yml"
# Also run in the action to install test-target scripts changes
- ".github/actions/setup-test-target-scripts/**"
- ".github/actions/setup-ddev/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref }}
Expand All @@ -26,8 +26,8 @@ jobs:
uses: ./.github/workflows/test-all-windows.yml

permissions:
# needed for compute-matrix in test-target.yml
contents: read
# needed for compute-matrix in test-target.yml
contents: read

with:
repo: core
Expand All @@ -39,14 +39,14 @@ jobs:

save-event:
needs:
- test
- test
if: success() || failure()

uses: ./.github/workflows/save-event.yml

upload-coverage:
needs:
- test
- test
if: >
!github.event.repository.private &&
(success() || failure())
Expand All @@ -57,27 +57,27 @@ jobs:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Download all coverage artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-*
path: coverage-reports
merge-multiple: false
- name: Download all coverage artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: coverage-*
path: coverage-reports
merge-multiple: false

- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
use_oidc: true
directory: coverage-reports
fail_ci_if_error: false
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
use_oidc: true
directory: coverage-reports
fail_ci_if_error: false

- name: Upload coverage to Datadog
if: always()
continue-on-error: true
uses: DataDog/coverage-upload-github-action@9bbbf86d16f7db1b14c5b885e61cf0d96053686a # v1.0.0
with:
api_key: ${{ secrets.DD_API_KEY }}
files: coverage-reports
format: cobertura
- name: Upload coverage to Datadog
if: always()
continue-on-error: true
uses: DataDog/coverage-upload-github-action@6c4bd935248daa6f0ef94e3e6ba71ad5ad079998 # v1.0.3
with:
api_key: ${{ secrets.DD_API_KEY }}
files: coverage-reports
format: cobertura
Loading
Loading