From 3e7fbe2925dc3b8d3d778ca62a5226c0955c7dbd Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Thu, 7 Apr 2022 18:16:29 -0700 Subject: [PATCH] Filter CI on PR contents + Mergify support --- .github/ISSUE_TEMPLATE/config.yml | 3 ++ .github/ISSUE_TEMPLATE/feature-request.yml | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 26 ++++++++--- .github/workflows/chipyard-run-tests.yml | 51 +++++++++++++++++++++- .mergify.yml | 24 ++++++++++ 5 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 .mergify.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 79f95b52..3940f67b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,6 +3,9 @@ contact_links: - name: Chipyard Mailing List url: https://groups.google.com/forum/#!forum/chipyard about: Please ask and answer questions here. + - name: FireSim Mailing List + url: https://groups.google.com/forum/#!forum/firesim + about: Please ask and answer questions here. - name: Rocket Chip Support url: https://github.com/chipsalliance/rocket-chip/issues about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 4683ecc6..c755a145 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -15,7 +15,7 @@ body: - type: textarea attributes: label: Feature Description - description: Description of feature wanted + description: Description of desired feature. validations: required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index aad565e7..c1df432a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,19 @@ + + **Related PRs / Issues**: @@ -17,11 +33,11 @@ **Contributor Checklist**: - [ ] Did you set `main` as the base branch? +- [ ] Is this PR's title suitable for inclusion in the changelog and have you added a `changelog:` label? +- [ ] Did you state the type-of-change/impact? - [ ] Did you delete any extraneous prints/debugging code? +- [ ] Did you mark the PR with a `changelog:` label? - [ ] (If applicable) Did you add documentation for the feature? - [ ] (If applicable) Did you add a test demonstrating the PR? - -- [ ] (If applicable) Did you mark the PR as "Please Backport"? - -**Release Notes** - + +- [ ] (If applicable) Did you mark the PR as `Please Backport`? diff --git a/.github/workflows/chipyard-run-tests.yml b/.github/workflows/chipyard-run-tests.yml index bc146ee1..99fabb74 100644 --- a/.github/workflows/chipyard-run-tests.yml +++ b/.github/workflows/chipyard-run-tests.yml @@ -1,10 +1,11 @@ name: chipyard-ci-process on: - # run ci on pull requests targeting main only (since the ci runs on the merge commit) + # run ci on pull requests targeting following branches (runs on the merge commit) pull_request: branches: - main + - '1.[0-9]*.x' env: tools-cache-version: v13 @@ -24,8 +25,42 @@ jobs: with: access_token: ${{ github.token }} + # Set up a set of boolean conditions to control which branches of the CI + # workflow will execute This is based off the conditional job execution + # example here: https://github.com/dorny/paths-filter#examples + change-filters: + name: filter-jobs-on-changes + runs-on: ubuntu-latest + # Queried by downstream jobs to determine if they should run. + outputs: + needs-docs: ${{ steps.filter.outputs.docs }} + needs-rtl-build: ${{ steps.filter.outputs.all_count != steps.filter.outputs.skip-rtl_count }} + + steps: + - uses: actions/checkout@v2 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + all: + - '**' + + # If any of the files changed match, do a doc build + docs: &docs-filter + - 'docs/**' + - '.readthedocs.yml' + + # If all files match to this filter, skip the main ci pipeline + skip-rtl: + - *docs-filter + - '**/*.md' + - '**/.gitignore' + - '.github/ISSUE_TEMPLATE/**' + commit-on-master-check: name: commit-on-master-check + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' runs-on: ubuntu-latest container: image: ucbbar/chipyard-ci-image:554b436 @@ -44,6 +79,8 @@ jobs: tutorial-setup-check: name: tutorial-setup-check + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' runs-on: ubuntu-latest container: image: ucbbar/chipyard-ci-image:554b436 @@ -62,6 +99,8 @@ jobs: documentation-check: name: documentation-check + needs: change-filters + if: needs.change-filters.outputs.needs-docs == 'true' runs-on: ubuntu-latest container: image: ucbbar/chipyard-ci-image:554b436 @@ -87,6 +126,8 @@ jobs: install-toolchains: name: install-toolchains + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' runs-on: ubuntu-latest container: image: ucbbar/chipyard-ci-image:554b436 @@ -105,6 +146,8 @@ jobs: build-extra-tests: name: build-extra-tests + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' needs: install-toolchains runs-on: ubuntu-latest container: @@ -136,6 +179,8 @@ jobs: install-verilator-knight: name: install-verilator-knight + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' runs-on: knight needs: cancel-prior-workflows steps: @@ -152,6 +197,8 @@ jobs: install-verilator-ferry: name: install-verilator-ferry + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' runs-on: ferry needs: cancel-prior-workflows steps: @@ -171,6 +218,8 @@ jobs: # When adding new prep jobs, please add them to `needs` below setup-complete: name: setup-complete + needs: change-filters + if: needs.change-filters.outputs.needs-rtl == 'true' needs: [install-toolchains, install-verilator-knight, install-verilator-ferry, build-extra-tests] runs-on: ubuntu-latest steps: diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 00000000..b386c184 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,24 @@ +pull_request_rules: + # For Chipyard version 1.x.y, here let x = minor, y = patch + # Only support backporting to the last minor release branch. + # This rule will need to be updated on minor releases. + - name: backport to latest minor release + conditions: + - merged + - base=main + - label="Please Backport" + actions: + backport: + branches: + - 1.13.x + ignore_conflicts: True + label_conflicts: "bp-conflict" + label: + add: [Backported] + + - name: label Mergify backport PR + conditions: + - body~=This is an automated backport of pull request \#\d+ d + actions: + label: + add: [Backport]