Skip to content

Commit

Permalink
Merge branch 'main' into azure-provision-instance
Browse files Browse the repository at this point in the history
  • Loading branch information
parasj authored Oct 23, 2022
2 parents 2911059 + 7737aa7 commit f0cb732
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: pytest
on:
push:
branches: [ main ]
# Publish semver tags as releases.
tags: [ '*.*.*' ]
pull_request:
# pull_request_target:
# types: [labeled]
pull_request_target:
types: [labeled]

jobs:
black-pytype:
# do not run on pull_request_target since it should be triggered by pull_request
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand All @@ -29,6 +34,8 @@ jobs:
- name: pytype
run: poetry run pytype --config .pytype.cfg -j 2
test-unit:
# do not run on pull_request_target since it should be triggered by pull_request
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request')
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -54,8 +61,8 @@ jobs:
poetry run skyplane init -y --disable-config-aws --disable-config-azure --disable-config-gcp
poetry run pytest -s tests/unit_nocloud
test-aws:
# run if push to main or pull request or pull request target with label 'safe to test'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')
# run if push to main or pull request by contributor or pull request target with label 'safe to test' (to avoid running on forks)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
runs-on: ubuntu-latest
needs: test-unit
steps:
Expand Down Expand Up @@ -83,8 +90,8 @@ jobs:
poetry run skyplane init -y --disable-config-azure --disable-config-gcp
poetry run pytest -s tests/unit_aws
test-azure:
# run if push to main or pull request or pull request target with label 'safe to test'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')
# run if push to main or pull request by contributor or pull request target with label 'safe to test' (to avoid running on forks)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
runs-on: ubuntu-latest
needs: test-unit
steps:
Expand Down Expand Up @@ -113,8 +120,8 @@ jobs:
poetry run skyplane init -y --disable-config-aws --disable-config-gcp
poetry run pytest -s tests/unit_azure
test-gcp:
# run if push to main or pull request or pull request target with label 'safe to test'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')
# run if push to main or pull request or pull request target with label 'safe to test' (to avoid running on forks)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
runs-on: ubuntu-latest
needs: test-unit
env:
Expand Down

0 comments on commit f0cb732

Please sign in to comment.