[Dev] Add deployment example for AI #107
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
# see: https://github.com/marketplace?type=actions | |
# see: https://github.com/google/yamlfmt | |
yamlfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: yamllint | |
uses: reviewdog/action-yamllint@v1 | |
with: | |
github_token: ${{ secrets.github_token }} | |
fail_on_error: true | |
- name: yamlfmt | |
uses: yk-lab/[email protected] | |
# see: https://github.com/google/autoyapf | |
pyfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
ref: ${{ github.head_ref }} | |
- name: autoyapf | |
id: autoyapf | |
uses: mritunjaysharma394/autoyapf@v2 | |
with: | |
args: --style pep8 --recursive . | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
- name: Push changes | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --local user.email "<githubusername>@users.noreply.github.com" | |
git config --local user.name "Python formatterBot" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git commit -am "Automated autoyapf fixes" | |
git push | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- uses: bazelbuild/setup-bazelisk@v3 | |
- name: Mount bazel cache # Optional | |
uses: actions/cache@v4 | |
with: | |
path: "~/.cache/bazel" | |
key: bazel | |
- run: gcc --version | |
- run: bazel test --config=cpplint //... | |
- run: bazel build --config=cpu -- //... | |
- run: bazel test --config=cpu -- //... |