-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47d1de8
commit 43f9aef
Showing
4 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
get-team-members: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
team-members: ${{ steps.get-team-members.outputs.team-members }} | ||
steps: | ||
- name: Get team members from GitHub API | ||
id: get-team-members | ||
run: | | ||
TEAM_MEMBERS=$(gh api /orgs/pnpm/teams/collaborators/members --paginate | jq -r '.[].login' | paste -sd, -) | ||
echo "team-members=$TEAM_MEMBERS" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
check-author: | ||
runs-on: ubuntu-latest | ||
needs: get-team-members | ||
outputs: | ||
is-external: ${{ steps.check-author.outputs.is-external }} | ||
steps: | ||
- name: Check if PR is from a team member | ||
id: check-author | ||
run: | | ||
TEAM_MEMBERS="${{ needs.get-team-members.outputs.team-members }}" | ||
if [ "${{ github.event.pull_request }}" != "" ]; then | ||
if echo "$TEAM_MEMBERS" | grep -q "${{ github.actor }}"; then | ||
echo "PR is from a team member." | ||
echo "is-external=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "PR is from an external contributor." | ||
echo "is-external=true" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "Not a PR, running the workflow." | ||
echo "is-external=false" >> $GITHUB_OUTPUT | ||
fi | ||
require-approval: | ||
runs-on: ubuntu-latest | ||
needs: check-author | ||
if: needs.check-author.outputs.is-external == 'true' | ||
steps: | ||
- name: Manual Approval | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const prNumber = context.payload.pull_request.number; | ||
const repo = context.repo; | ||
github.rest.pulls.requestReviewers({ | ||
owner: repo.owner, | ||
repo: repo.repo, | ||
pull_number: prNumber, | ||
reviewers: ['nachoaldamav'] | ||
}); | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
windows-tests: | ||
needs: [require-approval, get-team-members] | ||
uses: ./.github/workflows/windows.yml@${{ github.ref_name }} | ||
|
||
macos-tests: | ||
needs: [require-approval, get-team-members] | ||
uses: ./.github/workflows/macos.yml@${{ github.ref_name }} | ||
|
||
linux-tests: | ||
needs: [require-approval, get-team-members] | ||
uses: ./.github/workflows/linux.yml@${{ github.ref_name }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
name: E2E Linux (Google Cloud) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
linux-e2e: | ||
|
This file contains 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
This file contains 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