diff --git a/.github/Customize_Instructions.md b/.github/Customize_Instructions.md new file mode 100644 index 0000000..d4b1e85 --- /dev/null +++ b/.github/Customize_Instructions.md @@ -0,0 +1,5 @@ +## Customize Instructions + +To customize the configure for individual project repo: +1. Copy the config file from `.github/default` to `.github/custom` and make changes accordingly. +2. You should not modify files inside `.github/default` and `.github/workflows`. diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 0000000..a1a755d --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,21 @@ +# Set to true to add reviewers to pull requests +addReviewers: true +# Set to true to add assignees to pull requests +addAssignees: false +# A number of reviewers added to the pull request +# Set 0 to add all the reviewers (default: 0) +numberOfReviewers: 1 +# A number of assignees to add to the pull request +# Set to 0 to add all of the assignees. +# Uses numberOfReviewers if unset. +# numberOfAssignees: 2 +# Set to true to add reviewers from different groups to pull requests +useReviewGroups: true +# A list of reviewers, split into different groups, to be added to pull requests (GitHub user name) +reviewGroups: + groupQA: + - placeholder + groupDev: + - placeholder +# Set to true to add assignees from different groups to pull requests +useAssigneeGroups: false diff --git a/.github/custom/.gitkeep b/.github/custom/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.github/default/.gitkeep b/.github/default/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.github/default/pre_release_config.py b/.github/default/pre_release_config.py new file mode 100644 index 0000000..936a874 --- /dev/null +++ b/.github/default/pre_release_config.py @@ -0,0 +1,40 @@ +CONFIG = { + "folder_analysis": { + "exclude_filenames": { + r"^\..*", + r"^__.*", + r"LICENSE.md", + }, + "exclude_paths": {r"imgs"}, + }, + "readme": { + "mandatory_headings": {"Purpose", "Project Description"}, + "mandatory_sections": {"License"}, + "unnumbered_heading": { + "Purpose", + "Project Description", + "Table of Contents", + }, + # Text line to force a exact match in final readme + # Add line no (from template) to the mandatory_lines + # use int or string as L3-4 + "mandatory_lines": [ + 3, + 4, + ], + # Text line to ignore + # Add line no (from template) here to suppress the warning + # use int or string as L3-4 + "ignore_lines": [ + "L6-8", + "L27-41", + "L143-204", + "L219-220", + "L225-227", + ], + }, + "commented_code": { + # Lines does not count as commendted code + "special_lines": {"# -*- coding: utf-8 -*-"} + }, +} diff --git a/.github/default/spellcheck.yaml b/.github/default/spellcheck.yaml new file mode 100644 index 0000000..90d03af --- /dev/null +++ b/.github/default/spellcheck.yaml @@ -0,0 +1,26 @@ +# spellcheck.yaml +matrix: +- name: Markdown + expect_match: false + apsell: + mode: en + dictionary: + wordlists: + - wordlist.txt + output: wordlist.dic + encoding: utf-8 + pipeline: + - pyspelling.filters.markdown: + markdown_extensions: + - markdown.extensions.extra: + - pyspelling.filters.html: + comments: true + attributes: + - title + - alt + ignores: + - ':matches(code, pre)' + - 'code' + - 'pre' + sources: + - '**/*.md' diff --git a/.github/default/wordlist.txt b/.github/default/wordlist.txt new file mode 100644 index 0000000..87c783b --- /dev/null +++ b/.github/default/wordlist.txt @@ -0,0 +1,109 @@ +accessable +apis +arn +aws +backend +boolean +boto +broswer +cli +cloudformation +cloudinary +cloudwatch +codebase +codebases +codepackage +cpu +creativecommons +crontab +css +csvs +cuda +deployable +depricated +dev +develpment +discoverable +dockerfile +dropbox +embeddings +encyption +enviroment +exisitng +facebook +framerate +github +gmail +gpu +gpus +graphdb +html +https +ipynb +javascript +json +jupyter +jupyterlab +juypter +linux +localhost +macos +manpages +nlp +nodejs +notebbok +npm +nvidia +opencv +paramaters +parametrized +preprocess +preprocessing +pretrained +pretraining +py +readme +redistributions +rekognition +repo +scientific's +sdk +serverless +sfl +subfolder +submodule +tensorflow +terraform +testcase +tradeoffs +txt +ui +unhashed +unix +vpc +wsl +yaml +yml +zipcode +Ferrante +Luk +Segala +config +dataset +resampling +XGBoost +NoDerivatives +legalcode +nd +Licensor +immunities +Licensor +enforceability +merchantability +Generis +NonCommercial +URI +waivable +ies +WIPO +synched diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..dea7283 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,25 @@ +# Description + +Please include a summary of the change. +Please also include relevant motivation and context. +List any dependencies that are required for this change. + +## Type of change (select all that apply) + +Please delete options that are not relevant. + +- [ ] Bug Fix +- [ ] Iterative improvement or optimization +- [ ] New Feature +- [ ] Documentation update + +# Tests/QA + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce + +# Checklist: + +- [ ] Tests have been ran and everything still works +- [ ] Code and other files are formatted to style guidelines +- [ ] Code and other files pass automated checks for TODOs, typos etc +- [ ] Documentation is updated as needed \ No newline at end of file diff --git a/.github/workflows/autoassign.yml b/.github/workflows/autoassign.yml new file mode 100644 index 0000000..b5cbd2f --- /dev/null +++ b/.github/workflows/autoassign.yml @@ -0,0 +1,28 @@ +name: Auto Assign yml updater +on: + pull_request: + types: [opened reopened] +jobs: + yamlupdate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: before + run: cat .github/auto_assign.yml + - name: AutoBotYamlFileUpdater + uses: SFLScientific/AutoBotYaml@master + with: + token: ${{ secrets.SFLOrgReadAccessToken }} + - name: after + run: cat .github/auto_assign.yml + - name: Commit changes + uses: EndBug/add-and-commit@v4 + with: + message: "Updated auto_assign.yml" + add: ".github/auto_assign.yml" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + diff --git a/.github/workflows/ipynb_to_md.yml b/.github/workflows/ipynb_to_md.yml new file mode 100644 index 0000000..ad5356f --- /dev/null +++ b/.github/workflows/ipynb_to_md.yml @@ -0,0 +1,25 @@ +name: IPYNB to MD +# only run on notebook update +on: + push: + branches-ignore: template-action-updates + paths: + - '**.ipynb' +jobs: + makepdfs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: IPYNB to MD + uses: SFLScientific/IPYNB_to_MD@master + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3.5.0 + with: + commit-message: PR with converted to MD + committer: AutoCommit + title: File conversions IPYNB to MD + body: This is an auto-generated PR + labels: mds,pdfs, automated pr + branch: pynb-to-md-pdf-patches diff --git a/.github/workflows/lint_markdown.yml b/.github/workflows/lint_markdown.yml new file mode 100644 index 0000000..9871b56 --- /dev/null +++ b/.github/workflows/lint_markdown.yml @@ -0,0 +1,19 @@ +name: Lint Markdown +on: workflow_dispatch + # push: + # branches-ignore: template-action-updates + # paths: + # - '**.md' +jobs: + autopep8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - name: Lint changelog file + uses: docker://avtodev/markdown-lint:v1 + with: + rules: '/lint/rules/changelog.js' + config: '/lint/config/changelog.yml' + args: '**.md' diff --git a/.github/workflows/md_to_pdf.yml b/.github/workflows/md_to_pdf.yml new file mode 100644 index 0000000..14a2e6e --- /dev/null +++ b/.github/workflows/md_to_pdf.yml @@ -0,0 +1,44 @@ +name: MD to PDF +# only run if .md updated +on: + pull_request: + branches: + - main + - master + paths: + - '**.md' +jobs: + makepdfs: + runs-on: ubuntu-latest + if: ${{ (github.repository != 'SFLScientific/SFL-Template') }} + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + # converts all special chars to safe in the mds and makes backups + - name: Format trees in MDs + run: for F in $(find | grep -i "readme"); do cp $F $F.orig && sed -i 's/├/\+/g; s/│/\|/g; s/─/-/g; s/└/\\/g' $F;done + - name: MD to PDF conversion + uses: SFLScientific/MDtoPDF@1.0.3 + # move original mds back into place + - name: Move original MDs back + run: for F in $(find | grep -i ".md.orig"); do mv $F $(echo $F | sed 's/.orig//g') ;done + # remove all .pdf.orig pdfs that were untracked and not readme + - name: Remove .pdf.orig files + run: for pdf in $(find | grep ".pdf.orig"); do rm $pdf; done + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3.10.0 + with: + commit-message: PR with converted to PDF + committer: AutoCommit + title: File conversions MD_to_PDF + body: This is an auto-generated PR + labels: pdfs, automated pr + branch: ${{ format('md-to-pdf_{0}', github.head_ref) }} + - name: Merge Pull Request + uses: juliangruber/merge-pull-request-action@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + number: ${{ steps.cpr.outputs.pull-request-number }} + method: squash \ No newline at end of file diff --git a/.github/workflows/pre_release_checks.yml b/.github/workflows/pre_release_checks.yml new file mode 100644 index 0000000..c785fa6 --- /dev/null +++ b/.github/workflows/pre_release_checks.yml @@ -0,0 +1,70 @@ +name: Pre-release-checks +on: + workflow_dispatch: + release: + types: [prereleased] + +jobs: + Pre-release-checks: + # Fetch the working branch + runs-on: ubuntu-latest + steps: + - name: Fetch the current master + uses: actions/checkout@master + with: + path: master + lfs: False + + # Fetch the template + - name: Fetch the original template + uses: actions/checkout@master + with: + ref: template + path: template + lfs: False + + # Run pre-release checks + - name: Release check + id: release_check + uses: SFLScientific/pre-relase-checks@v1.3 + + # Upload the pre-release check log + - name: Upload artifact + uses: actions/upload-artifact@v1 + if: always() + with: + name: Pre_release_check_log + path: pre_release_check.log + + - name: Get md5sum for current readme pdf + if: always() + run: | + if [ $(find | grep -i "readme.pdf" | wc -l) -eq 0 ]; then + echo "The could not the PDF version in readme file" > pdf_check.log + exit 1; + fi; + md5sum $(find . -type f -iname readme.pdf) > temp.txt + + - name: Converts all special chars to safe in the mds and makes backups + run: for F in $(find | grep -i "readme.md"); do cp $F $F.orig && sed -i 's/├/\+/g; s/│/\|/g; s/─/-/g; s/└/\\/g' $F;done + + - name: Convert Markdown to PDF + uses: valtyr/pandoc-action@v0.1-alpha + + - name: Compare the MD5 of two version of readme.pdf + run: | + echo $(md5sum -c temp.txt) + success=$(md5sum -c temp.txt | grep "OK" | wc -l) + if [ $success -eq 1 ]; then + exit 0; + else + echo "The readme.pdf does not match with readme.md" > pdf_check.log + exit 1; + fi; + + - name: Upload PDF check log + uses: actions/upload-artifact@v1 + if: always() + with: + name: Pre_release_check_log + path: pdf_check.log diff --git a/.github/workflows/python_formatter.yml b/.github/workflows/python_formatter.yml new file mode 100644 index 0000000..5872c79 --- /dev/null +++ b/.github/workflows/python_formatter.yml @@ -0,0 +1,29 @@ +name: Format python code +# only run if .py is changed +on: + push: + branches-ignore: template-action-updates + paths: + - '**.py' +jobs: + autopep8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: autopep8 + uses: peter-evans/autopep8@v1 + with: + args: --recursive --in-place --aggressive --aggressive . + - name: blackformatter + uses: lgeiger/black-action@master + with: + args: . + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3.5.0 + with: + commit-message: autopep8 action fixes + committer: AutoCommit + title: Fixes by autopep8 action + body: This is an auto-generated PR with fixes by autopep8. + labels: autopep8, automated pr + branch: autopep8-patches diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 0000000..962efcd --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,18 @@ +name: Check Spelling +# https://github.com/marketplace/actions/check-spelling-js-vue-html-markdown-text +# for conifg +# make this a required check for merge +on: + push: + branches-ignore: template-action-updates + paths: + - '**.txt' + - '**.md' +jobs: + spelling: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check Spelling (JS, Vue, HTML, Markdown, Text) [Forked][wordlist + spellcheck freedom] [SFL] + uses: SFLScientific/spellcheck-github-actions@master + diff --git a/.github/workflows/tensecheck.yml b/.github/workflows/tensecheck.yml new file mode 100644 index 0000000..bd92d61 --- /dev/null +++ b/.github/workflows/tensecheck.yml @@ -0,0 +1,19 @@ +name: Argument tense check +on: + pull_request: + branches: + - main + - master + paths: + - '**.py' +jobs: + spelling: + if: ${{ (github.head_ref != 'template-action-updates') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Status Check for present tense args + uses: SFLScientific/PresentTenseArgs@master + + + diff --git a/.github/workflows/todocheck.yml b/.github/workflows/todocheck.yml new file mode 100644 index 0000000..f1fd4b9 --- /dev/null +++ b/.github/workflows/todocheck.yml @@ -0,0 +1,16 @@ +name: TODO and comment check +on: + pull_request: + branches: + - main + - master +jobs: + spelling: + runs-on: ubuntu-latest + if: ${{ (github.repository != 'SFLScientific/SFL-Template') && (github.head_ref != 'template-action-updates')}} + steps: + - uses: actions/checkout@v2 + - name: TODO and Commented out code status check + uses: SFLScientific/TODOandCommentedCodeCheck@1.3 + + diff --git a/README.pdf b/README.pdf new file mode 100644 index 0000000..753ee4a Binary files /dev/null and b/README.pdf differ