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

Allow access to secrets for external contributors #318

Merged
merged 2 commits into from
Jun 29, 2022
Merged
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
22 changes: 19 additions & 3 deletions .github/workflows/check-test-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
name: Check, test and release
on:
push:
pull_request:
pull_request_target:
schedule:
- cron: '0 7 * * 1' # M H d m w (Mondays at 7:00)

env:
MLEM_TESTS: "true"

jobs:
authorize:
if: |
startsWith(github.ref, 'refs/tags') ||
github.event_name == 'pull_request_target' ||
github.event_name == 'schedule' ||
github.repository_owner != 'iterative'
environment:
${{ (github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository) &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: echo ✓
check:
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'pull_request' || github.event_name == 'schedule' || github.repository_owner != 'iterative'
needs: authorize
name: Check
runs-on: ubuntu-latest
steps:
Expand All @@ -21,6 +34,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
- name: set PYSHA
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
Expand All @@ -31,7 +45,7 @@ jobs:
- run: pip install -U pre-commit tox
- run: SKIP=pylint pre-commit run -a --show-diff-on-failure
test:
if: startsWith(github.ref, 'refs/tags') || github.event_name == 'pull_request' || github.event_name == 'schedule' || github.repository_owner != 'iterative'
needs: authorize
name: Test ${{ matrix.os }} with py${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -47,6 +61,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -103,6 +118,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v2
- id: dist
uses: casperdcl/deploy-pypi@v2
Expand Down