Reset _closeables in _init for flow reuse
#79
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2020 Iguazio | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: CI Privileged | |
| permissions: | |
| contents: read | |
| on: pull_request_target | |
| jobs: | |
| is-safe-to-test: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_safe: ${{ steps.check.outputs.result }} | |
| steps: | |
| - name: Require collaborator or safe-to-test label | |
| id: check | |
| uses: actions/github-script@v7 | |
| with: | |
| result-encoding: string | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const author = pr.user.login; | |
| const labels = pr.labels.map(l => l.name); | |
| const hasSafeLabel = labels.includes("safe-to-test"); | |
| if (hasSafeLabel) return true; | |
| let isCollaborator = false; | |
| try { | |
| await github.rest.repos.checkCollaborator({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| username: author | |
| }); | |
| isCollaborator = true; | |
| } catch (err) { | |
| if (err.status !== 404) throw err; | |
| } | |
| return isCollaborator; | |
| fail-if-unsafe: | |
| runs-on: ubuntu-latest | |
| needs: is-safe-to-test | |
| if: ${{ needs.is-safe-to-test.outputs.is_safe == 'false' }} | |
| steps: | |
| - name: Fail if not marked as safe to test | |
| run: | | |
| echo "Integration tests will not run on a PR unless it has the safe-to-test label applied" | |
| exit 1 | |
| integration: | |
| name: Integration tests | |
| runs-on: [ self-hosted, Linux ] | |
| needs: is-safe-to-test | |
| if: ${{ needs.is-safe-to-test.outputs.is_safe == 'true' }} | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, 3.11 ] | |
| include: | |
| - python-version: 3.9 | |
| image: python:3.9.18 | |
| - python-version: 3.11 | |
| image: python:3.11.8 | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| repository: ${{ github.event.workflow_run.head_repository.full_name }} | |
| ref: ${{ github.event.workflow_run.head_branch }} | |
| - name: Install dependencies | |
| run: make dev-env | |
| - name: Run integration tests | |
| env: | |
| V3IO_API: ${{ secrets.V3IO_API }} | |
| V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }} | |
| V3IO_FRAMESD: ${{ secrets.V3IO_FRAMESD }} | |
| run: make integration |