<commit_before>name: Cypress
on: [push, pull_request]

jobs:
  cypress-run:
    name: Test
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        browsers: [chrome]
    services:
      mongodb:
        image: mongo:3.6.19
        ports:
          - 27017:27017

    steps:
      # We use .npmrc to set the default version to 0, and prevents download during developement.
      # This installs it specifically in the CI runs.
      - name: Set Action Environment Variables
        run: |
          echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
          echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
          echo "CYPRESS_INSTALL_BINARY=5.3.0" >> $GITHUB_ENV

      - name: Checkout Source Files
        uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Cache node modules
        uses: actions/cache@v2
        env:
          cache-name: cache-node-modules
        with:
          # npm cache files are stored in `~/.npm` on Linux/macOS
          path: ~/.npm
          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-
            ${{ runner.os }}-build-
            ${{ runner.os }}-

      - name: Set freeCodeCamp Environment Variables
        run: cp sample.env .env

      - name: Install Dependencies
        run: |
          npm ci
          npm run ensure-env

      - name: Seed Database
        run: npm run seed

      - name: Cypress run
        uses: cypress-io/github-action@v1
        with:
          record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
          build: npm run build
          # this should mirror the production build, but for now we're just using the dev
          # server and gatsby serve instead (the npm script serve:client needs updating!)
          start: npm start<commit_msg>chore: Cypress action v1 -> v2 (#40253)<commit_after>name: Cypress
on: [push, pull_request]

jobs:
  cypress-run:
    name: Test
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        browsers: [chrome]
    services:
      mongodb:
        image: mongo:3.6.19
        ports:
          - 27017:27017

    steps:
      # We use .npmrc to set the default version to 0, and prevents download during developement.
      # This installs it specifically in the CI runs.
      - name: Set Action Environment Variables
        run: |
          echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
          echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
          echo "CYPRESS_INSTALL_BINARY=5.3.0" >> $GITHUB_ENV

      - name: Checkout Source Files
        uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Cache node modules
        uses: actions/cache@v2
        env:
          cache-name: cache-node-modules
        with:
          # npm cache files are stored in `~/.npm` on Linux/macOS
          path: ~/.npm
          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-build-${{ env.cache-name }}-
            ${{ runner.os }}-build-
            ${{ runner.os }}-

      - name: Set freeCodeCamp Environment Variables
        run: cp sample.env .env

      - name: Install Dependencies
        run: |
          npm ci
          npm run ensure-env

      - name: Seed Database
        run: npm run seed

      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
          build: npm run build
          # this should mirror the production build, but for now we're just using the dev
          # server and gatsby serve instead (the npm script serve:client needs updating!)
          start: npm start
{'fraction_non_alphanumeric': 0.11328125, 'fraction_numerical': 0.014892578125, 'mean_word_length': 1.8730715287517532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4911837', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1217, 'n_words': 356}