Skip to content

ci: improve e2e check #346

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

Merged
merged 1 commit into from
Jul 24, 2025
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
27 changes: 8 additions & 19 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
branches:
- master
- main
types: [ 'opened', 'synchronize' ]
types: ["opened", "synchronize"]
paths:
- 'quickstarts/**'
- 'solution/**'
- "quickstarts/**/**.tf"
- "solution/**/**.tf"

jobs:
terraform-fmt:
Expand All @@ -21,7 +21,6 @@ jobs:
terraform -chdir=quickstarts fmt -check -recursive
terraform -chdir=solution fmt -check -recursive


terraform-validate:
runs-on: ubuntu-latest
steps:
Expand All @@ -34,8 +33,7 @@ jobs:
dir_names: "true"
separator: ","
files: |
quickstarts/*
solution/*
{quickstarts,solution}/**/*.tf
dir_names_max_depth: 3
- name: Terraform validate
run: |
Expand All @@ -58,38 +56,29 @@ jobs:
fi
done


e2e-check:
needs: [terraform-fmt, terraform-validate]
runs-on: ubuntu-latest
name: e2e check
steps:
- name: checkout
uses: actions/checkout@v3
- name: Checking the max commits number
run: |
commitNum=${{ github.event.pull_request.commits }}
if [[ ${commitNum} -gt 1 ]]; then
echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
exit 1
fi
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v34
uses: tj-actions/changed-files@v46
with:
dir_names: "true"
separator: ","
files: |
quickstarts/*
solution/*
{quickstarts,solution}/**/*.tf
dir_names_max_depth: 3
- name: set id
id: set-job-id
uses: ayachensiyuan/get-action-job-id@v1.6
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
job-name: 'e2e check'
job-name: "e2e check"
- name: get pull request info
run: |
echo "repo name is" ${{github.event.pull_request.head.repo.full_name}}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pull Request
on:
pull_request:
branches:
- master
- main
types: ["opened", "synchronize"]
paths:
- "quickstarts/**"
- "solution/**"

jobs:
commit-check:
runs-on: ubuntu-latest
name: commit check
steps:
- name: checkout
uses: actions/checkout@v3
- name: Checking the max commits number
run: |
commitNum=${{ github.event.pull_request.commits }}
if [[ ${commitNum} -gt 1 ]]; then
echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
exit 1
fi