Skip to content

Commit ca96c45

Browse files
committed
ci: improve e2e check
1 parent 10f3e30 commit ca96c45

File tree

4 files changed

+35
-20
lines changed

4 files changed

+35
-20
lines changed

.github/workflows/e2e.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
branches:
55
- master
66
- main
7-
types: [ 'opened', 'synchronize' ]
7+
types: ["opened", "synchronize"]
88
paths:
9-
- 'quickstarts/**'
10-
- 'solution/**'
9+
- "quickstarts/**/**.tf"
10+
- "solution/**/**.tf"
1111

1212
jobs:
1313
terraform-fmt:
@@ -21,7 +21,6 @@ jobs:
2121
terraform -chdir=quickstarts fmt -check -recursive
2222
terraform -chdir=solution fmt -check -recursive
2323
24-
2524
terraform-validate:
2625
runs-on: ubuntu-latest
2726
steps:
@@ -34,8 +33,7 @@ jobs:
3433
dir_names: "true"
3534
separator: ","
3635
files: |
37-
quickstarts/*
38-
solution/*
36+
{quickstarts,solution}/**/*.tf
3937
dir_names_max_depth: 3
4038
- name: Terraform validate
4139
run: |
@@ -58,38 +56,29 @@ jobs:
5856
fi
5957
done
6058
61-
6259
e2e-check:
6360
needs: [terraform-fmt, terraform-validate]
6461
runs-on: ubuntu-latest
6562
name: e2e check
6663
steps:
6764
- name: checkout
6865
uses: actions/checkout@v3
69-
- name: Checking the max commits number
70-
run: |
71-
commitNum=${{ github.event.pull_request.commits }}
72-
if [[ ${commitNum} -gt 1 ]]; then
73-
echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
74-
exit 1
75-
fi
7666
- name: Get changed files
7767
id: changed-files
78-
uses: tj-actions/changed-files@v34
68+
uses: tj-actions/changed-files@v46
7969
with:
8070
dir_names: "true"
8171
separator: ","
8272
files: |
83-
quickstarts/*
84-
solution/*
73+
{quickstarts,solution}/**/*.tf
8574
dir_names_max_depth: 3
8675
- name: set id
8776
id: set-job-id
8877
uses: ayachensiyuan/get-action-job-id@v1.6
89-
env:
78+
env:
9079
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9180
with:
92-
job-name: 'e2e check'
81+
job-name: "e2e check"
9382
- name: get pull request info
9483
run: |
9584
echo "repo name is" ${{github.event.pull_request.head.repo.full_name}}

.github/workflows/pull_request.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Pull Request
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
types: ["opened", "synchronize"]
8+
paths:
9+
- "quickstarts/**"
10+
- "solution/**"
11+
12+
jobs:
13+
commit-check:
14+
runs-on: ubuntu-latest
15+
name: commit check
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v3
19+
- name: Checking the max commits number
20+
run: |
21+
commitNum=${{ github.event.pull_request.commits }}
22+
if [[ ${commitNum} -gt 1 ]]; then
23+
echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
24+
exit 1
25+
fi

quickstarts/VPC/101-vswitch-docs-Example-01/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ resource "alicloud_vswitch" "foo" {
1212
cidr_block = "172.16.0.0/21"
1313
vpc_id = alicloud_vpc.foo.id
1414
zone_id = data.alicloud_zones.foo.zones.0.id
15-
}
15+
}

quickstarts/VPC/101-vswitch-docs-Example-02/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ No modules.
2525
## Inputs
2626

2727
No inputs.
28+
2829
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)