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

ci: add auto approve validation #561

Merged
merged 1 commit into from
Oct 6, 2023
Merged
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
51 changes: 45 additions & 6 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
name: 🤖 Auto approve by bot
name: 🤖 Auto approve validation
on: pull_request

env:
PR_JOBS_NAME: '[ "Packages", "Demo", "Firebase", "Lint result", "tests", "E2E result" ]'
RELEASE_JOBS_NAME: '[ "Publish" ]'

jobs:
automated-pull-request:
setup:
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
matrix: ${{ steps.matrix.outputs.value }}
steps:
- uses: actions/checkout@v4.1.0
- uses: taiga-family/ci/actions/setup/checkout@v1.25.8
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/auto/approve/[email protected]
- id: matrix
if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true'
run: |
if [[ "${{ env.IS_RELEASE_BRANCH }}" == "false" ]]; then
echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT
else
echo "value=$RELEASE_JOBS_NAME" >> $GITHUB_OUTPUT
fi

wait:
needs: [setup]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
value: ${{ fromJSON(needs.setup.outputs.matrix) }}
steps:
- uses: taiga-family/ci/actions/run/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
job: ${{ matrix.value }}

approve:
needs: [wait]
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/auto/approve/[email protected]
with:
token1: ${{ secrets.GITHUB_TOKEN }}
token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }}
- uses: taiga-family/ci/actions/run/[email protected]
if: env.IS_RELEASE_BRANCH == 'false'
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}

concurrency:
group: auto-approve-${{ github.head_ref }}
cancel-in-progress: true
9 changes: 9 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ jobs:
run:
npm run cy:run -- --spec "**/(angular|react|ssr|addons|others)/**/*.cy.ts" --config baseUrl="${{
env.UNIVERSAL_SERVER }}"

result:
if: ${{ !contains(github.head_ref, 'release/') }}
needs: [build-demo, e2e-kit, e2e-recipes, e2e-others]
runs-on: ubuntu-latest
name: E2E result
steps:
- run: echo "Success"

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
7 changes: 7 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ jobs:
- uses: taiga-family/ci/actions/auto/[email protected]
if: env.SUPPORT_AUTO_PUSH == 'true'

result:
needs: [typecheck, cspell, prettier, stylelint, eslint]
runs-on: ubuntu-latest
name: Lint result
steps:
- run: echo "Success"

concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down