Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authorize step to both PR workflows #2644

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
24 changes: 17 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
pull_request_target:

concurrency:
group: continuous-integration-${{ github.head_ref }}
cancel-in-progress: true

jobs:
authorize:
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 ✓

build:
needs: authorize
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand All @@ -19,6 +27,7 @@ jobs:
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Setup Python environment
uses: actions/setup-python@v4
Expand All @@ -33,14 +42,15 @@ jobs:
cache: 'yarn'

- name: Turbo cache
if: ${{ github.ref_name != 'main' }}
id: turbo-cache
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
key:
turbo-${{ github.job }}-${{ github.head_ref }}-${{
github.event.pull_request.head.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
turbo-${{ github.job }}-${{ github.head_ref }}-

- run: yarn run install-frozen-lockfile

Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/cross-platform-test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
name: Cross-Platform Test
on:
push:
branches:
- main
pull_request:
pull_request_target:

concurrency:
group: cross-platform-${{ github.head_ref }}
cancel-in-progress: true

jobs:
authorize:
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 ✓

suite:
needs: authorize
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
Expand All @@ -22,6 +29,7 @@ jobs:
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Setup Node.js environment
uses: actions/setup-node@v3
Expand All @@ -30,16 +38,15 @@ jobs:
cache: yarn

- name: Turbo cache
if: ${{ github.ref_name != 'main' }}
id: turbo-cache
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key:
turbo-${{ runner.os }}-${{ github.job }}-${{ github.ref_name }}-${{
github.sha }}
turbo-${{ runner.os }}-${{ github.job }}-${{ github.head_ref }}-${{
github.event.pull_request.head.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ github.job }}-${{ github.ref_name }}-
turbo-${{ runner.os }}-${{ github.job }}-${{ github.head_ref }}-

- run: yarn install

Expand Down