github: refactor github action yaml files

This commit refactors the github action yaml files by putting the common
steps into an action file, and upgrades the tools used.
This commit is contained in:
yyforyongyu 2022-11-14 15:55:08 +08:00
parent 5bea444b6d
commit 268be87abe
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868

View file

@ -186,10 +186,10 @@ jobs:
parallel: true parallel: true
######################## ########################
# run integration tests # run ubuntu integration tests
######################## ########################
integration-test: ubuntu-integration-test:
name: run itests name: run ubuntu itests
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')' if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
strategy: strategy:
@ -230,17 +230,18 @@ jobs:
- name: Zip log files on failure - name: Zip log files on failure
if: ${{ failure() }} if: ${{ failure() }}
timeout-minutes: 1 # timeout after 1 minute timeout-minutes: 5 # timeout after 5 minute
run: 7z a logs-itest-${{ matrix.name }}.zip itest/**/*.log run: 7z a logs-itest-${{ matrix.name }}.zip itest/**/*.log
- name: Upload log files on failure - name: Upload log files on failure
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v3
if: ${{ failure() }} if: ${{ failure() }}
with: with:
name: logs-itest-${{ matrix.name }} name: logs-itest-${{ matrix.name }}
path: logs-itest-${{ matrix.name }}.zip path: logs-itest-${{ matrix.name }}.zip
retention-days: 5 retention-days: 5
######################## ########################
# run windows integration test # run windows integration test
######################## ########################
@ -258,15 +259,15 @@ jobs:
go-version: '${{ env.GO_VERSION }}' go-version: '${{ env.GO_VERSION }}'
- name: run itest - name: run itest
run: make itest-parallel windows=1 tranches=2 parallel=2 run: make itest-parallel windows=1 tranches=2 parallel=2 timeout=180m
- name: Zip log files on failure - name: Zip log files on failure
if: ${{ failure() }} if: ${{ failure() }}
timeout-minutes: 1 # timeout after 1 minute timeout-minutes: 5 # timeout after 5 minute
run: 7z a logs-itest-windows.zip itest/**/*.log run: 7z a logs-itest-windows.zip itest/**/*.log
- name: Upload log files on failure - name: Upload log files on failure
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
if: ${{ failure() }} if: ${{ failure() }}
with: with:
name: logs-itest-windows name: logs-itest-windows