.github/workflows/test.yml in datadog_api_client-2.4.0 vs .github/workflows/test.yml in datadog_api_client-2.5.0

- old
+ new

@@ -6,22 +6,25 @@ on: pull_request: branches: - master + schedule: + - cron: "0 3 * * *" concurrency: group: unit-${{ github.head_ref }} cancel-in-progress: true jobs: pre-commit: runs-on: ubuntu-latest if: > - github.event.pull_request.draft == false && - !contains(github.event.pull_request.labels.*.name, 'ci/skip') && - !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') + (github.event.pull_request.draft == false && + !contains(github.event.pull_request.labels.*.name, 'ci/skip') && + !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || + github.event_name == 'schedule' steps: - name: Get GitHub App token id: get_token uses: tibdex/github-app-token@v1 with: @@ -32,16 +35,16 @@ fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} token: ${{ steps.get_token.outputs.token }} - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install pre-commit run: python -m pip install pre-commit - name: set PY - run: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV - - uses: actions/cache@v2 + run: echo "PY=$(python -c 'import platform;print(platform.python_version())')" >> $GITHUB_ENV + - uses: actions/cache@v3 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - id: pre_commit name: Run pre-commit @@ -60,30 +63,26 @@ git commit -m "pre-commit fixes" git push origin "HEAD:${HEAD_REF}" exit 1 env: HEAD_REF: ${{ github.event.pull_request.head.ref }} + - id: pre_commit_schedule + name: Run pre-commit in schedule + if: github.event_name == 'schedule' + run: | + pre-commit run --all-files --show-diff-on-failure --color=always test: strategy: matrix: ruby-version: ["2.6", "3.1", "jruby"] - platform: [ubuntu-latest, macos-latest] # , windows-latest] - # test only latest version on macos and windows - exclude: - - platform: macos-latest - ruby-version: "2.6" - - platform: macos-latest - ruby-version: "jruby" - # - platform: windows-latest - # ruby-version: '2.6' - # - platform: windows-latest - # ruby-version: '2.6' + platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} - if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') + if: (github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule' env: BUNDLE_WITHOUT: docs + DD_PROFILING_NO_EXTENSION: true steps: - uses: actions/checkout@v3 - name: Set up Ruby ${{ matrix.ruby-version }} uses: ruby/setup-ruby@v1 with: @@ -95,10 +94,10 @@ run: ./run-tests.sh shell: bash examples: runs-on: ubuntu-latest - if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') + if: (github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule' env: DD_PROFILING_NO_EXTENSION: true steps: - uses: actions/checkout@v3 - name: Set up Ruby