Inspiration from cypress-slack-video-upload-action and cypress-slack-reporter using gh-actions-template
Required Slack app token. See Internal app tokens
- Create an app
- Under Bot Token Scopes, add
files:write
andchat:write
permissions - Install the app into your workspace
- Invite the bot to whatever channels you want to send the videos and screenshots to
/invite <botname>
- Grab the
Bot User OAuth Token
from theOAuth & Permissions
page - Add that token as a secret to your Github repo's
Actions Secrets
found underSettings -> Secrets
(in the examples below we call itSLACK_TOKEN
)
Required Slack channels to upload to
Optional The folder where Cypress stores screenshots and videos on the build machine.
Default: cypress
(this relative path resolves to /home/runner/work/<REPO_NAME>/<REPO_NAME>/cypress
)
If your project uses Cypress from the project root folder, the default value will work for you.
But if your project uses Cypress in a subfolder (like most monorepos), you'll need to provide the relative path to that folder
(i.e. e2e/cypress
).
(Don't include a trailing slash on your path!)
on: [push]
jobs:
test-and-upload-results:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: 'Run tests'
uses: cypress-io/github-action@v2
- name: 'Upload screenshots and videos to Slack'
uses: ngocsangyem/cypress-notify
with:
token: ${{ secrets.SLACK_TOKEN }}
channels: 'engineering-ops'
on: [pull_request]
jobs:
test-and-upload-results-on-fail:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: 'Run tests'
uses: cypress-io/github-action@v2
- name: 'Upload screenshots and videos to Slack'
uses: ngocsangyem/cypress-notify
if: failure()
with:
token: ${{ secrets.SLACK_TOKEN }}
channels: 'engineering-ops'
yarn setup
npm run setup
Some workflows
are included by default.
CI Workflow
- ESLint
- Jest
- Send coverage report to codecov if
CODECOV_TOKEN
is set.
- Send coverage report to codecov if
- Release GitHub Actions
- if tag is added.
- Publish package
- if tag is added and
NPM_AUTH_TOKEN
is set.
- if tag is added and
- Publish release
- if 3 and 4 jobs are succeeded.
- Notify by slack
- if workflow is failure
ACCESS_TOKEN is required.
Add the release tag when pull request is merged.
- Get next version from commits histories.
see Conventional Commits - Add tag.
- Create branch for next version.
ACCESS_TOKEN is required.
Create TOC (Table of contents)
ACCESS_TOKEN is required.
- Assign the issue to project
default setting:Project: Backlog Column: To do
- Assign author to issue
- Assign the PR to project
default setting:ACCESS_TOKEN is required.Project: Backlog Column: In progress
- Assign author to PR
- Add labels by branch
setting
- Add labels by changed files setting
- Create PR histories
- Manage PR by release type
ACCESS_TOKEN is required. - Check version in package.json
ACCESS_TOKEN is required. - Check if it can be published to npm
ifNPM_AUTH_TOKEN
is set
Manage labels by moving project cards
Check broken link in README
Update package dependencies
- schedule
- PR opened, closed
- repository dispatch
Add tag for test release
Personal access token with the public_repo or repo scope
(repo is required for private repositories)
https://api.slack.com/messaging/webhooks
technote-space/release-github-actions-cli - GitHub
- Create
.env
Set Personal access tokentoken=1234567890abcdef1234567890abcdef12345678
- Run
yarn release
- Dry run:
yarn release -n
- Help:
yarn release -h
- Dry run:
Then, you can use your GitHub Actions
like follows:
on: push
name: Test
jobs:
toc:
name: Test
runs-on: ubuntu-latest
steps:
- uses: owner/repo@gh-actions
technote-space/github-action-helper - GitHub
technote-space/github-action-test-helper - GitHub