GithubのActionsタブから新しいActionを追加する
# .github/workflows/実行するアクションの名前.ymlでファイルを作る
$ touch .github/workflows/run-tests-on-pr-towards-develop.yml
.github/workflows/run-tests-on-pr-towards-develop.yml
name: Run Tests on PR towards develop branch
# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the develop branch
pull_request:
branches: [ develop ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install npm packages
run: npm install
- name: Run Tests
run: npm run test