Skip to main content

Github Actions

Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow.

Refer to official documentation for detailed usage. →

The following YAML workflow file created into the .github/workflows/ci.yml as a default by superplate, if GitHub Actions selected as a CI plugin.

.github/workflows/ci.yml
name: ci
on:  push:    branches:      - main      - master  pull_request:    branches:      - main      - master
jobs:  ci:    runs-on: ${{ matrix.os }}
    strategy:      matrix:        os: [ubuntu-latest]        node: [14]
    steps:      - name: Checkout        uses: actions/checkout@master
      - name: Setup node env        uses: actions/setup-node@v2.1.2        with:          node-version: ${{ matrix.node }}
      - name: Cache node_modules        uses: actions/cache@v2        with:          path: ~/.npm          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}          restore-keys: |            ${{ runner.os }}-node-
      - name: Install dependencies        run: npm ci
      - name: Run tests        run: npm run test
tip

The following commands are added to .github/workflows/ci.yml by superplate if any of plugins listed below is selected during project creation phase.

note

You can use the following commands in case of adding Github Actions to existing project later.

Package manager#


- name: Cache node_modules  uses: actions/cache@v2  with:    path: ~/.npm    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}    restore-keys: |      ${{ runner.os }}-node-

Install dependencies#


- name: Install dependencies   run: npm ci

Run ESlint#


- name: Run lint  run: npm run lint

Testing#


Run tests#

- name: Run tests  run: npm run test

Run Cypress E2E Testing#

- name: Run e2e test  run: npm run cypress:test

WebdriverIO E2E Testing#

- name: Run e2e test  run: npm run webdriver:run
tip

We recommend using Meercode, if you are using Github Actions. Meercode is the monitoring dashboard for your CI/CD builds.