@@ -14,28 +14,22 @@ jobs:
1414 terraform-fmt :
1515 runs-on : ubuntu-latest
1616 steps :
17- - name : checkout
18- uses : actions/checkout@v3
19- - name : terraform-fmt
20- run : |
21- if [ ! -f /usr/local/bin/terraform ]; then
22- wget -q https://releases.hashicorp.com/terraform/1.6.0/terraform_1.6.0_linux_amd64.zip
23- unzip terraform_1.6.0_linux_amd64.zip -d /usr/local/bin/
24- fi
25- error=false
26- echo "===> Terraform fmt -diff checking in quickstarts"
27- (terraform -chdir=quickstarts fmt -check -recursive -list=false) || error=true
28- terraform -chdir=quickstarts fmt -diff -recursive
29- if ${error}; then
30- echo -e "\033[31m[ERROR]\033[0m: Some quickstarts codes has not been formatted, and please running terraform fmt --recursive command before pushing."
31- exit 1
32- fi
17+ - uses : actions/checkout@v4
18+
19+ - uses : hashicorp/setup-terraform@v3
20+
21+ - name : Terraform fmt
22+ id : fmt
23+ run : terraform -chdir=quickstarts fmt -check -recursive -list=false
24+
3325
3426 terraform-validate :
3527 runs-on : ubuntu-latest
3628 steps :
37- - name : checkout
38- uses : actions/checkout@v3
29+ - uses : actions/checkout@v4
30+
31+ - uses : hashicorp/setup-terraform@v3
32+
3933 - name : Get changed files
4034 id : changed-files
4135 uses : tj-actions/changed-files@v34
4640 dir_names_max_depth : 3
4741 - name : pr-check
4842 run : |
49- if [ ! -f /usr/local/bin/terraform ]; then
50- wget -q https://releases.hashicorp.com/terraform/1.6.0/terraform_1.6.0_linux_amd64.zip
51- unzip terraform_1.6.0_linux_amd64.zip -d /usr/local/bin/
52- fi
5343 CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
44+ echo "CHANGED_FOLDERS is ${CHANGED_FOLDERS}"
5445 if [ -z "${{ github.event.number }}" ]; then
5546 CHANGED_FOLDERS=$(find ./quickstarts -maxdepth 2 -mindepth 2 -type d | tr '\n' ',')
5647 fi
@@ -61,47 +52,47 @@ jobs:
6152 bash scripts/terraform-validate.sh ${CHANGED_FOLDERS}
6253
6354
64- e2e-check :
65- needs : [terraform-fmt, terraform-validate]
66- runs-on : ubuntu-latest
67- name : ' e2e check'
68- steps :
69- - name : checkout
70- uses : actions/checkout@v3
71- - name : Checking the max commits number
72- run : |
73- commitNum=${{ github.event.pull_request.commits }}
74- if [[ ${commitNum} -gt 1 ]]; then
75- echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
76- exit 1
77- fi
78- - name : Get changed files
79- id : changed-files
80- uses : tj-actions/changed-files@v34
81- with :
82- dir_names : " true"
83- separator : " ,"
84- files : " quickstarts/*"
85- dir_names_max_depth : 3
86- - name : set id
87- id : set-job-id
88- uses :
ayachensiyuan/[email protected] 89- env :
90- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91- with :
92- job-name : ' e2e check'
93- - name : get pull request info
94- run : |
95- echo "repo name is" ${{github.event.pull_request.head.repo.full_name}}
96- echo "branch is" ${{github.event.pull_request.head.ref}}
97- echo "the current job id is ${{ steps.set-job-id.outputs.jobId }}"
98- - name : e2e test
99- run : |
100- CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
101- if [ -z "$CHANGED_FOLDERS" ]; then
102- echo "No changed quickstarts found"
103- exit 0
104- fi
105- objectPath="github-action/${{github.repository}}/e2e/Action-${{github.run_number}}-${{github.run_id}}-${{ steps.set-job-id.outputs.jobId }}"
106- curl -H "X-Fc-Invocation-Type:Async" -s https://example-ci-terrafoodule-ci-svrrwvrpnj.ap-southeast-1.fcapp.run/?branch=${{github.event.pull_request.head.ref}}\&repo_name=${{github.event.pull_request.head.repo.full_name}}\&oss_object_path=${objectPath}
107- go run scripts/e2e_check.go ${objectPath}
55+ # e2e-check:
56+ # needs: [terraform-fmt, terraform-validate]
57+ # runs-on: ubuntu-latest
58+ # name: 'e2e check'
59+ # steps:
60+ # - name: checkout
61+ # uses: actions/checkout@v3
62+ # - name: Checking the max commits number
63+ # run: |
64+ # commitNum=${{ github.event.pull_request.commits }}
65+ # if [[ ${commitNum} -gt 1 ]]; then
66+ # echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
67+ # exit 1
68+ # fi
69+ # - name: Get changed files
70+ # id: changed-files
71+ # uses: tj-actions/changed-files@v34
72+ # with:
73+ # dir_names: "true"
74+ # separator: ","
75+ # files: "quickstarts/*"
76+ # dir_names_max_depth: 3
77+ # - name: set id
78+ # id: set-job-id
79+ # uses: ayachensiyuan/[email protected] 80+ # env:
81+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+ # with:
83+ # job-name: 'e2e check'
84+ # - name: get pull request info
85+ # run: |
86+ # echo "repo name is" ${{github.event.pull_request.head.repo.full_name}}
87+ # echo "branch is" ${{github.event.pull_request.head.ref}}
88+ # echo "the current job id is ${{ steps.set-job-id.outputs.jobId }}"
89+ # - name: e2e test
90+ # run: |
91+ # CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
92+ # if [ -z "$CHANGED_FOLDERS" ]; then
93+ # echo "No changed quickstarts found"
94+ # exit 0
95+ # fi
96+ # objectPath="github-action/${{github.repository}}/e2e/Action-${{github.run_number}}-${{github.run_id}}-${{ steps.set-job-id.outputs.jobId }}"
97+ # curl -H "X-Fc-Invocation-Type:Async" -s https://example-ci-terrafoodule-ci-svrrwvrpnj.ap-southeast-1.fcapp.run/?branch=${{github.event.pull_request.head.ref}}\&repo_name=${{github.event.pull_request.head.repo.full_name}}\&oss_object_path=${objectPath}
98+ # go run scripts/e2e_check.go ${objectPath}
0 commit comments