diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..528df845 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,55 @@ +name: Deployment Workflow + +on: + push: + branches: + - main + +jobs: + + linters: + name: Linting checks + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run linters + run: npm run lint + + tests: + name: Test checks + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run test \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/pr_evaluation.yml similarity index 70% rename from .github/workflows/main.yml rename to .github/workflows/pr_evaluation.yml index dcd5f82f..d78e2f7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/pr_evaluation.yml @@ -1,17 +1,16 @@ -name: PR Evaluation & Deployment Workflow +name: PR Evaluation on: pull_request: - types: edited - branches: ['main'] - push: + types: [opened, synchronize, reopened, ready_for_review, edited] branches: ['main'] jobs: - lint_pr: - name: Validate PR title + semantic_pr: + name: Semantic PR title runs-on: ubuntu-latest + if: ${{ github.event.action != 'edited' || github.event.changes.title != null }} steps: - uses: amannn/action-semantic-pull-request@v5 env: @@ -31,8 +30,6 @@ jobs: ci chore revert - # Configure that a scope must always be provided. - requireScope: true # Configure additional validation for the subject based on a regex. # This example ensures the subject doesn't start with an uppercase character & has more than 50 chars. subjectPattern: ^(?![A-Z])(?=.{1,50}$).+$ @@ -44,12 +41,23 @@ jobs: didn't match the configured pattern. Please ensure that the subject doesn't start with an uppercase character & not have more than 50 characters. + detect-unresolved-conflicts: + name: Detect unresolved merge conflicts + runs-on: ubuntu-latest + needs: semantic_pr + steps: + - uses: actions/checkout@v3 + - name: List files with merge conflict markers + run: git --no-pager grep "<<<<<<<" ":(exclude).github/" || true + - name: Fail or succeed job if any files with merge conflict markers have been checked in + # Find lines containing "<<<<<<<", then count the number of lines. + # 0 matching lines results in exit code 0, i.e. success. + run: exit $(git grep "<<<<<<<" ":(exclude).github/" | wc --lines) + linters: name: Linting checks runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x, 20.x] + needs: semantic_pr steps: - name: Check out code @@ -57,10 +65,10 @@ jobs: with: fetch-depth: 2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js 20.x uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 20.x cache: 'npm' - name: Install dependencies @@ -72,6 +80,7 @@ jobs: tests: name: Test checks runs-on: ubuntu-latest + needs: semantic_pr strategy: matrix: node-version: [18.x, 20.x] @@ -92,4 +101,4 @@ jobs: run: npm install - name: Run tests - run: npm run test \ No newline at end of file + run: npm run test diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 231f49b0..dceb3944 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,65 +1,24 @@ ## Description -> Please include a summary of the change and the relevant issue(s) it resolves, -> if any (otherwise delete that line). Please also include relevant motivation -> and context briefly, especially if there exists no related issue and the -> change is non-trivial. List any dependencies that are required for this -> change. Please use bullet points for the description. For very trivial issues -> that are duly explained by the PR title, a description can be omitted. - -- +> Please include a summary of the change and the relevant issue(s) it resolves, if any (otherwise delete that line). Fixes #(issue) ## Checklist -> Please go through the following checklist to ensure that your change is ready -> for review. Please do not forget to double check the list after you have -> modified your PR, e.g., if you have added commits to address reviewer -> comments or to fix failing automated checks. Please check items also if they -> do not apply to your change, e.g., if your change does not require an update -> of the user-facing documentation, then still check the box. Generally, PRs -> are only reviewed when all boxes are ticked off and all automated checks pass -> (use the comment section below if you believe that your PR is ready to be -> merged even though not all boxes were ticked off). +> Please go through the following checklist to ensure that your change is ready for review. -- [ ] My code follows the [contributing guidelines][contributing] of this - project, including, in particular, with regard to any style guidelines -- [ ] The title of my PR complies with the [Conventional Commits - specification][conventional-commits]; in particular, it clearly indicates - that a change is a breaking change -- [ ] I am aware that all my commits will be squashed into a single commit, - using the PR title as the commit message. -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code in hard-to-understand areas -- [ ] I have updated the user-facing documentation to describe any new or - changed behavior -- [ ] I have added type annotations for all function/class/method interfaces - or updated existing ones -- [ ] I have provided [JSDoc][jsdoc] block tags for all - functions/classes/methods or updated existing ones -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature - works -- [ ] New and existing unit tests pass locally with my changes -- [ ] I have not reduced the existing code coverage -- [ ] I have asked the [@all-contributors bot][all-contributors-bot] to - acknowledge my contributions by commenting on this PR with a request of - the form `@all-contributors please add @YOUR_GH_HANDLE for TYPE_1, - TYPE_2, ...`, where `TYPE_1` etc. refer to [contribution types supported - by the All Contributors Specification][all-contributors-types] OR I do - not want my contributions to be acknowledged +- [ ] My code follows the [contributing guidelines][contributing] of this project. +- [ ] I am aware that all my commits will be squashed into a single commit, using the PR title as the commit message. +- [ ] I have performed a self-review of my own code. +- [ ] I have commented my code in hard-to-understand areas. +- [ ] I have updated the user-facing documentation to describe any new or changed behavior. +- [ ] My changes generate no new warnings. +- [ ] I have added tests that prove my fix is effective or that my feature works. +- [ ] I have not reduced the existing code coverage. ## Comments -> If there are unchecked boxes in the list above, but you would still like your -> PR to be reviewed or considered for merging, please describe here why boxes -> were not checked. For example, if you are positive that your commits should -> _not_ be squased when merging, please explain why you think the PR warrants -> or requires multiple commits to be added to the history. +> If there are unchecked boxes in the list above, but you would still like your PR to be reviewed or considered for merging, please describe here why boxes were not checked. -[all-contributors-bot]: https://allcontributors.org/docs/en/bot/overview -[all-contributors-types]: https://allcontributors.org/docs/en/emoji-key [contributing]: CONTRIBUTING.md -[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/ -[jsdoc]: https://jsdoc.app/index.html