-
Notifications
You must be signed in to change notification settings - Fork 70
refactor(ci): to not use circleci but only github #1936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: CI | ||
|
|
||
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Quality | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| linting: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Hope this makes sense. In a nutshell: let's not release major and deprecate Node.js v18 support in a migration to GitHub Actions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, this make sense. |
||
| fail-fast: true | ||
| max-parallel: 1 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
There was a problem hiding this comment.
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.