Setting Up GitHub Actions for an Ember CLI Project

Last reviewed on January 20, 2020

  1. Go to your repository on GitHub and click on the “Actions” tab.
  2. Click on the “New workflow” button on the left.
  3. Click on the “Set up a workflow yourself” button on the right.
  4. Copy and paste the following YAML configuration into the editor which will create the file .github/workflows/main.yml. Then click on the green “Start commit” button.
name: Ember

on: [pull_request]

    runs-on: ubuntu-latest

        node-version: [12.x]

      - uses: actions/checkout@v1
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
          node-version: ${{ matrix.node-version }}
      - name: Install Dependencies
        run: npm ci
      - name: JavaScript Linting
        run: npm run lint:js
      - name: Template Linting
        run: npm run lint:hbs
      - name: npm test
        run: npm test
          CI: true

The CI: true line will set an environment variable called CI for the npm test step, which will be used if your testem.js file contains the following line:

process.env.CI ? '--no-sandbox' : null;

The default testem.js file has this line.