chore: tidy up #1873
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CICD-PUSH | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| - '*/*' | |
| tags-ignore: | |
| - '*' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| BASE_BRANCH: origin/main | |
| GO_VERSION: "1.20" | |
| jobs: | |
| trigger-mode: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| trigger-mode: ${{ steps.get_trigger_mode.outputs.trigger_mode }} | |
| steps: | |
| - name: Cancel Previous Runs | |
| if: github.ref_name != 'main' | |
| uses: styfle/cancel-workflow-action@0.11.0 | |
| with: | |
| all_but_latest: true | |
| access_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get trigger mode | |
| id: get_trigger_mode | |
| run: | | |
| TRIGGER_MODE=`bash .github/utils/utils.sh --type 6 \ | |
| --branch-name "${{ github.ref_name }}" \ | |
| --base-branch "${{ env.BASE_BRANCH }}"` | |
| echo $TRIGGER_MODE | |
| echo trigger_mode=$TRIGGER_MODE >> $GITHUB_OUTPUT | |
| pre-push: | |
| needs: trigger-mode | |
| runs-on: ubuntu-latest | |
| name: Push Pre-Check | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| - name: install pcregrep | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install pcregrep | |
| - name: gen pcregrep | |
| run: | | |
| pcregrep --exclude-dir=mtr -r -n -I '[^\x00-\x7f]' . > pcregrep.out | |
| - name: pcregrep Chinese | |
| run: | | |
| FILE_PATH=`git diff --name-only HEAD HEAD^` | |
| python ${{ github.workspace }}/.github/utils/pcregrep.py \ | |
| --source="${{ github.workspace }}/pcregrep.out" \ | |
| --filter="$FILE_PATH" | |
| - name: Spell Check with Typos | |
| if: contains(needs.trigger-mode.outputs.trigger-mode, '[docs]') | |
| uses: crate-ci/typos@v1.13.14 | |
| with: | |
| files: docs/ | |
| config: .github/utils/typos.toml | |
| make-test: | |
| needs: trigger-mode | |
| runs-on: ubuntu-latest | |
| if: contains(needs.trigger-mode.outputs.trigger-mode, '[test]') | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup Poetry | |
| uses: Gr1N/setup-poetry@v8 | |
| with: | |
| poetry-version: "1.6.1" | |
| - name: make lint | |
| run: | | |
| pip install ruff | |
| make lint | |
| # - name: make static-check | |
| # run: | | |
| # pip install mypy | |
| # make lint | |
| - name: make test | |
| run: | | |
| make test | |
| check-image: | |
| needs: trigger-mode | |
| if: ${{ contains(needs.trigger-mode.outputs.trigger-mode, '[docker]') }} | |
| uses: apecloud/apecloud-cd/.github/workflows/release-image-check.yml@v0.1.49 | |
| with: | |
| IMG: "apecloud/aperag" | |
| BUILDX_PLATFORMS: "linux/amd64" | |
| DOCKERFILE_PATH: "./Dockerfile" | |
| PYTHON_VERSION: "3.11" | |
| POETRY_VERSION: "1.6.1" | |
| secrets: inherit | |
| check-helm: | |
| needs: trigger-mode | |
| if: ${{ contains(needs.trigger-mode.outputs.trigger-mode, '[deploy]') }} | |
| uses: apecloud/apecloud-cd/.github/workflows/release-charts-check.yml@v0.1.48 | |
| with: | |
| VERSION: "v0.4.0-check" | |
| CHART_NAME: "aperag" | |
| CHART_DIR: "deploy" | |
| APECD_REF: "v0.1.48" | |
| secrets: inherit |