Add module testing for analyze articles for Polytech subject #115
This file contains hidden or 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: BlogReactera CI (building, linting, testing) | |
| on: # Правила запуска workflow | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| pipeline: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| permissions: | |
| contents: write # Необходимо для отправки отчетов в ветку gh-pages | |
| pull-requests: write # Необходимо для отправки комментария со ссылкой на отчет к пулл-реквесту | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Staring Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: install modules | |
| run: npm install | |
| - name: build production project | |
| run: npm run build:prod | |
| if: always() | |
| - name: linting typescript | |
| run: npm run lint:ts | |
| if: always() | |
| - name: linting scss | |
| run: npm run lint:scss | |
| if: always() | |
| - name: unit testing | |
| run: npm run test:unit | |
| if: always() | |
| - name: screenshot testing (Run Testplane) | |
| id: testplane | |
| uses: gemini-testing/gh-actions-testplane@v1 | |
| with: | |
| html-report-prefix: 'reports/testplane' # Сохраняем отчеты в имеющуюся директорию reports (для сохранения отчетов на gh-pages) | |
| storybook: 'true' # Запускаем тесты плагина `@testplane/storybook` | |
| browser: 'linux-chrome' # Запускаем тесты только в Chrome | |
| - name: Deploy report # Выкладывает отчет на gh-pages | |
| if: always() && steps.testplane.outputs.html-report-path | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} # Токен поставляется Github, дополнительной настройки не требуется | |
| publish_dir: ${{ steps.testplane.outputs.html-report-path }} | |
| destination_dir: ${{ steps.testplane.outputs.html-report-path }} | |
| keep_files: true | |
| - name: Comment PR with link to Testplane HTML report | |
| if: always() && steps.testplane.outputs.html-report-path && github.event_name == 'pull_request' | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| message: | | |
| ### Testplane run finished | |
| Testplane HTML-report is available at https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.testplane.outputs.html-report-path }} | |
| comment-tag: testplane_html_report_link |