|
| 1 | +name: ORFS variables.yaml tester and linter |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + docs-test-job: |
| 8 | + name: 'Tests for variables.yaml' |
| 9 | + runs-on: ubuntu-latest |
| 10 | + container: |
| 11 | + image: openroad/ubuntu-cpp20 |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + submodules: 'recursive' |
| 17 | + - name: Run YAML script |
| 18 | + run: | |
| 19 | + python3 flow/scripts/generate-variable-docs.py |
| 20 | + - name: Run YAML Lint |
| 21 | + run: | |
| 22 | + pip install yamllint==1.35.1 |
| 23 | + yamllint flow/scripts/variables.yaml |
| 24 | +
|
| 25 | + docs-pr-update: |
| 26 | + name: 'Create PR to update ORFS FlowVariables.md' |
| 27 | + needs: |
| 28 | + - docs-test-job |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - name: Checkout repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + - name: Run generate-variable-docs.py |
| 34 | + run: | |
| 35 | + python3 flow/scripts/generate-variable-docs.py |
| 36 | + - name: Create branch if diff exists |
| 37 | + id: docs-update |
| 38 | + run: | |
| 39 | + git config --local user.email "github-actions[bot]@users.noreply.github.com" |
| 40 | + git config --local user.name "github-actions[bot]" |
| 41 | + if [ -n "$(git status --porcelain)" ]; then |
| 42 | + echo "has_update=true" >> "$GITHUB_OUTPUT" |
| 43 | + else |
| 44 | + echo "has_update=false" >> "$GITHUB_OUTPUT" |
| 45 | + fi |
| 46 | + git add . |
| 47 | + git commit --signoff -m "[Docs]: Update ORFS FlowVariables.md" |
| 48 | + - name: Only push if not master |
| 49 | + if: "github.event.client_payload.branch != 'master'" |
| 50 | + id: remote-update-pr |
| 51 | + run: | |
| 52 | + git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head" |
| 53 | + - name: Create docs update PR |
| 54 | + if: "steps.remote-update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'" |
| 55 | + uses: peter-evans/create-pull-request@v5 |
| 56 | + with: |
| 57 | + token: ${{ github.token }} |
| 58 | + signoff: true |
| 59 | + delete-branch: true |
| 60 | + title: "[BOT] Update ORFS variables" |
| 61 | + reviewers: | |
| 62 | + vvbandeira |
| 63 | + maliberty |
| 64 | + draft: true |
| 65 | + branch: bot-update-variables |
| 66 | + commit-message: | |
| 67 | + [BOT] Update ORFS variables |
0 commit comments