Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 0 additions & 143 deletions .circleci/config.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is re-used among the actions.


description: Shared action to install dependencies

runs:
using: composite

steps:
- name: Install pnpm
uses: pnpm/[email protected]
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install
run: pnpm install
shell: bash
95 changes: 95 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Quality

on:
push:
branches:
- master
pull_request:

jobs:
linting:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We start with lining. So static analysis.

name: Linting
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/ci

- name: Lint
run: pnpm lint

type-checking:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type checking runs in parallel.

name: Type checking
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/ci

- name: TypeScript
run: pnpm typecheck:ts

- name: Flow
run: pnpm typecheck:flow

testing:
name: Testing
needs: [linting, type-checking]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only test once our static analysis finished.

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/ci

- name: Build
run: pnpm build

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Test (with coverage)
run: pnpm test:coverage:ci

- name: Integration tests
run: pnpm test:integration

regression-testing:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We isolate out the integration tests. The idea is that we consider this regression testing. Where we run on the nvmrc's version of Node.js before. Then we test if our changes cause regressions on older versions of Node.js

name: Regression Testing
needs: [testing]
runs-on: ubuntu-latest
strategy:
matrix:
version: [18, 20]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better if we set this matrix to [20, 22], since 18 is now in maintenance mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We test 22 in the regular testing flow. That's defined in the .nvmrc and what we develop with. v18 is not EoL and we officially still support it. Hence I would argue to also regression test for it. If we drop it, we should officially do so using the engines field and a major release. Keep in mind that with the latest major release we require >= Node.js v18 - prior we said to support v12 even.

Hope this makes sense. In a nutshell: let's not release major and deprecate Node.js v18 support in a migration to GitHub Actions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this make sense.

fail-fast: true
max-parallel: 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important. We run against one project in integration tests. We can't run in parallel.


steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/ci

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}

- name: Build
run: pnpm build

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Integration tests
run: pnpm test:integration
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,8 @@ jobs:
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
token: ${{ steps.generate_github_token.outputs.token }}

- name: Install pnpm
uses: pnpm/[email protected]
with:
run_install: false

- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup
uses: ./.github/actions/ci

- name: Creating .npmrc
run: |
Expand Down
7 changes: 2 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
</p>

<p align="center">
<a href="https://travis-ci.org/commercetools/nodejs">
<img alt="Travis CI Status" src="https://img.shields.io/travis/commercetools/nodejs/master.svg?style=flat-square&label=travis">
<a href="https://github.com/commercetools/nodejs/actions">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed. These were wrong for a long time.

<img alt="GitHub Actions Status" src="https://github.com/commercetools/nodejs/actions/workflows/quality.yml/badge.svg">
</a>
<a href="https://codecov.io/gh/commercetools/nodejs">
<img src="https://img.shields.io/codecov/c/github/commercetools/nodejs.svg" alt="Codecov" />
</a>
<a href="https://waffle.io/commercetools/nodejs-tasks-board">
<img alt="Waffle.io Board" src="https://img.shields.io/badge/Waffle-board-yellow.svg?style=flat-square">
</a>
</p>

The **commercetools nodejs** repo is managed as a [monorepo](https://github.com/lerna/lerna) and contains different npm packages.
6 changes: 3 additions & 3 deletions docs/cli/csv-parser-orders.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CSV Parser Orders

[![Travis Build Status][travis-icon]][travis]
[![GitHub Actions Status][github-actions-icon]][github-actions]
[![Codecov Coverage Status][codecov-icon]][codecov]
[![David Dependencies Status][david-icon]][david]
[![David devDependencies Status][david-dev-icon]][david-dev]
Expand Down Expand Up @@ -468,8 +468,8 @@ More delivery examples can be seen [here](https://github.com/commercetools/nodej

[commercetools]: https://commercetools.com/
[commercetools-icon]: https://cdn.rawgit.com/commercetools/press-kit/master/PNG/72DPI/CT%20logo%20horizontal%20RGB%2072dpi.png
[travis]: https://travis-ci.org/commercetools/csv-parser-orders
[travis-icon]: https://img.shields.io/travis/commercetools/csv-parser-orders/master.svg?style=flat-square
[github-actions]: https://github.com/commercetools/nodejs/actions/workflows/quality.yml
[github-actions-icon]: https://github.com/commercetools/nodejs/actions/workflows/quality.yml/badge.svg
[codecov]: https://codecov.io/gh/commercetools/csv-parser-orders
[codecov-icon]: https://img.shields.io/codecov/c/github/commercetools/csv-parser-orders.svg?style=flat-square
[david]: https://david-dm.org/commercetools/csv-parser-orders
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/csv-parser-price.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CSV Parser Price

[![Travis Build Status][travis-icon]][travis]
[![GitHub Actions Status][github-actions-icon]][github-actions]
[![Codecov Coverage Status][codecov-icon]][codecov]
[![David Dependencies Status][david-icon]][david]
[![David devDependencies Status][david-dev-icon]][david-dev]
Expand Down Expand Up @@ -181,8 +181,8 @@ JSON object returned from the conversion of the CSV file above

[commercetools]: https://commercetools.com/
[commercetools-icon]: https://cdn.rawgit.com/commercetools/press-kit/master/PNG/72DPI/CT%20logo%20horizontal%20RGB%2072dpi.png
[travis]: https://travis-ci.org/commercetools/csv-parser-price
[travis-icon]: https://img.shields.io/travis/commercetools/csv-parser-price/master.svg?style=flat-square
[github-actions]: https://github.com/commercetools/nodejs/actions/workflows/quality.yml
[github-actions-icon]: https://github.com/commercetools/nodejs/actions/workflows/quality.yml/badge.svg
[codecov]: https://codecov.io/gh/commercetools/csv-parser-price
[codecov-icon]: https://img.shields.io/codecov/c/github/commercetools/csv-parser-price.svg?style=flat-square
[david]: https://david-dm.org/commercetools/csv-parser-price
Expand Down