kind: pipeline
type: docker
name: test

volumes:
  - name: npmrc
    host:
      path: /home/albertyw/.ssh/other/npmrc

steps:
  - name: Test Node
    image: satantime/puppeteer-node:17.2-bullseye-slim
    commands:
      - npm version
      - npm ci
      - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > "${HOME}/bin/cc-test-reporter" && chmod +x "${HOME}/bin/cc-test-reporter"
      - chmod +x "${HOME}/bin/cc-test-reporter"
      - cc-test-reporter before-build
      - npm test
      - exitcode="$?"
      - cc-test-reporter after-build --exit-code "$exitcode"
    environment:
      CC_TEST_REPORTER_ID: 272eecf2546da3d8959201092992794402b86f42235d3e1b489a2a5c67e23ad4

  - name: Test Packaging
    image: node:16
    commands:
      - npm version
      - apt-get update && apt-get install -y zip
      - npm ci
      - npm run package

  - name: Publish Node
    image: node:16
    commands:
      - npm whoami
      - npm publish
    volumes:
      - name: npmrc
        path: /root/.npmrc
    depends_on:
      - Test Node
      - Test Packaging
    when:
      event:
        - tag

kind: pipeline
type: docker
name: test

volumes:
  - name: npmrc
    host:
      path: /home/albertyw/.ssh/other/npmrc

steps:
  - name: Test Node
    image: satantime/puppeteer-node:16-bullseye-slim
    commands:
      - npm version
      - npm ci
      - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > "${HOME}/bin/cc-test-reporter" && chmod +x "${HOME}/bin/cc-test-reporter"
      - chmod +x "${HOME}/bin/cc-test-reporter"
      - cc-test-reporter before-build
      - npm test
      - exitcode="$?"
      - cc-test-reporter after-build --exit-code "$exitcode"
    environment:
      CC_TEST_REPORTER_ID: 272eecf2546da3d8959201092992794402b86f42235d3e1b489a2a5c67e23ad4

  - name: Test Packaging
    image: node:16
    commands:
      - npm version
      - apt-get update && apt-get install -y zip
      - npm ci
      - npm run package

  - name: Publish Node
    image: node:16
    commands:
      - npm whoami
      - npm publish
    volumes:
      - name: npmrc
        path: /root/.npmrc
    depends_on:
      - Test Node
      - Test Packaging
    when:
      event:
        - tag

Downgrade puppeteer docker to use same node version
Downgrade puppeteer docker to use same node version
