Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Update README.md

Update README.md #2

Workflow file for this run

name: Unittests
on:
push:
branches:
- master
- py27_tests_container
pull_request:
branches:
- master
schedule:
- cron: '0 4 * * *'
jobs:
# Special job which automatically cancels old runs for the same branch, prevents runs for the
# same file set which has already passed, etc.
pre_job:
name: Skip Duplicate Jobs Pre Job
runs-on: ubuntu-latest
permissions:
actions: write # Needed for skip-duplicate-jobs job
contents: read
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v4.0.0
with:
cancel_others: 'true'
github_token: ${{ github.token }}
coverage:
runs-on: ubuntu-latest
if: (success() || failure()) && (${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'master' }})
needs:
- pre_job
- unittests
- monitor-smoketests
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
- name: Install pycoverage
run: pip install coverage==4.5.4
- name: Download coverage reports
uses: actions/download-artifact@v3
with:
path: reports
- name: Prepare Coverage Data for codecov.io
run: |
coverage combine reports/**/.coverage
coverage xml -i -o coverage.xml
- name: Upload Coverage to Codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3.1.4
with:
files: ./coverage.xml
fail_ci_if_error: true
unittests:
name: Unittests - Python ${{ matrix.python-version }} - ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
needs: pre_job
# NOTE: We always want to run job on master branch
if: (success() || failure()) && (${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'master' }})
timeout-minutes: 10
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
os:
- ubuntu-20.04
platform:
- ubuntu
include:
- os: windows-2022
platform: windows
python-version: "3.10"
- os: macos-11
platform: macos
python-version: "3.10"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
dev-requirements.txt
windows-unit-tests-requirements.txt
benchmarks/micro/requirements-compression-algorithms.txt
- name: Install tox
env:
TOX_VERSION: 3.20.1
TOX_GH_ACTIONS_VERSION: 2.9.1
run: |
python -m pip install --upgrade pip
pip install "tox==$TOX_VERSION" "tox-gh-actions==$TOX_GH_ACTIONS_VERSION"
- name: Run Unit Tests
run: tox
env:
PLATFORM: ${{ matrix.platform }}
KIND: unittests
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}-${{ matrix.platform }}
path: |
test-results/junit*.xml
.coverage
if: ${{ success() || failure() }}
- name: Notify Slack on Failure
if: ${{ failure() && github.ref_name == 'master' }}
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#eng-dataset-cloud-tech'
standalone-smoketests:
name: Standalone Smoketests - Python ${{ matrix.python-version }} - ${{ matrix.variant }}
runs-on: ubuntu-20.04
needs: pre_job
# NOTE: We always want to run job on master branch
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'master' }}
timeout-minutes: 15
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
variant:
- std
include:
- variant: ratelimit
python-version: "3.10"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install tox
env:
TOX_VERSION: 3.20.1
TOX_GH_ACTIONS_VERSION: 2.9.1
run: |
python -m pip install --upgrade pip
pip install "tox==$TOX_VERSION" "tox-gh-actions==$TOX_GH_ACTIONS_VERSION"
- name: Run Standalone Smoketests
run: tox
env:
VARIANT: ${{ matrix.variant }}
KIND: smoketests
SCALYR_API_KEY: ${{ secrets.CT_SCALYR_TOKEN_PROD_US_CLOUDTECH_TESTING_WRITE }}
READ_API_KEY: ${{ secrets.CT_SCALYR_TOKEN_PROD_US_CLOUDTECH_TESTING_READ }}
SCALYR_SERVER: https://agent.scalyr.com
AGENT_HOST_NAME: agent-smoke-standalone-${{ matrix.python-version }}-${{ github.run_number }}
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}-${{ matrix.variant }}
path: |
test-results/junit*.xml
if: ${{ success() || failure() }}
- name: Notify Slack on Failure
if: ${{ failure() && github.ref_name == 'master' }}
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#eng-dataset-cloud-tech'
monitor-smoketests:
name: Monitor Smoketests - Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
timeout-minutes: 10
needs: pre_job
# NOTE: We always want to run job on master branch
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref_name == 'master' }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install tox
env:
TOX_VERSION: 3.20.1
TOX_GH_ACTIONS_VERSION: 2.9.1
run: |
python -m pip install --upgrade pip
pip install "tox==$TOX_VERSION" "tox-gh-actions==$TOX_GH_ACTIONS_VERSION"
- name: Run Monitor Smoketests
run: |
rm -rf artifacts test-results .coverage
mkdir -p artifacts test-results
tox -e agent_monitors_ubuntu -- --artifacts-path artifacts -n 2 --junitxml=test-results/junit-1.xml
env:
SCALYR_API_KEY: ${{ secrets.CT_SCALYR_TOKEN_PROD_US_CLOUDTECH_TESTING_WRITE }}
READ_API_KEY: ${{ secrets.CT_SCALYR_TOKEN_PROD_US_CLOUDTECH_TESTING_READ }}
SCALYR_SERVER: https://agent.scalyr.com
AGENT_HOST_NAME: monitors-test-${{ github.run_number }}
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}-monitor-smoketests
path: |
.coverage
test-results/junit*.xml
artifacts
if: ${{ success() || failure() }}
- name: Notify Slack on Failure
if: ${{ failure() && github.ref_name == 'master' }}
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#eng-dataset-cloud-tech'
publish-test-results:
runs-on: ubuntu-latest
permissions:
checks: write # Needed for publish test results job
pull-requests: write # Needed for publish test results job
if: success() || failure()
needs:
- pre_job
- unittests
- standalone-smoketests
- monitor-smoketests
steps:
- name: Download test results
uses: actions/download-artifact@v3
with:
path: reports
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@4e7013f9576bd22ffdae979dc6e68cb9ec2aeece # pin@v2
with:
junit_files: "reports/**/junit*.xml"