-
Notifications
You must be signed in to change notification settings - Fork 27
[Chore][DEVX-571]: Move CI from CircleCI to Github Actions #1130
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: CI | ||
|
|
||
| description: Shared action to install dependencies | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: Read .nvmrc | ||
| id: nvm | ||
| run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT | ||
| shell: bash | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version-file: ".nvmrc" | ||
| cache: "yarn" | ||
|
|
||
| # Whenever on a changeset versioning PR | ||
| # Then installing can not fail with lockfile changes | ||
| # Because the package.json for integration test changes. | ||
|
|
||
| - name: Install | ||
| run: yarn install --immutable | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| name: Qa | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
| - '!changeset-release/**' | ||
|
|
||
| pull_request: | ||
|
|
||
| jobs: | ||
| immutable-install: | ||
| if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }} | ||
| name: Immutable Install | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/ci | ||
|
|
||
| # The shared install action does not respect the | ||
| # `--immutable` flag, so we need to run it here. | ||
| - name: Install with lockfile | ||
| run: yarn install --immutable | ||
|
|
||
| linting: | ||
|
|
||
| if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }} | ||
| name: Linting | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/ci | ||
|
|
||
| - name: Lint | ||
| run: yarn format | ||
|
|
||
| type-checking: | ||
|
|
||
| if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }} | ||
| name: Type checking | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/ci | ||
|
|
||
| - name: TypeScript | ||
| run: yarn typecheck | ||
|
|
||
| testing: | ||
|
|
||
| if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }} | ||
| name: Testing | ||
| needs: [immutable-install, linting, type-checking] | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/ci | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
|
|
||
| - uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f # v1.5 | ||
| with: | ||
| secrets: ${{ toJSON(secrets) }} | ||
|
|
||
|
|
||
| - name: Test (Examples) | ||
| run: | | ||
| cd examples | ||
| yarn install --immutable | ||
| yarn test | ||
|
|
||
| - name: Test (Unit) | ||
| run: yarn test:unit | ||
|
|
||
| - name: Test (Integration) | ||
| run: yarn test --coverage | ||
|
|
||
| - name: Upload Coverage Report | ||
| uses: codecov/codecov-action@v5 #2db07e317924c76f654a414629d71c65876882e2 v5.4.3 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: test-coverage | ||
|
|
||
| regression-testing: | ||
| if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }} | ||
| name: Regression Testing | ||
| needs: [testing] | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| version: [18, 20] | ||
| fail-fast: true | ||
| max-parallel: 1 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/ci | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: ${{ matrix.version }} | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
|
|
||
| - uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f # v1.5 | ||
| with: | ||
| secrets: ${{ toJSON(secrets) }} | ||
|
|
||
|
|
||
| - name: Integration tests | ||
| run: yarn test | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would it make sense to add the checkout step here also, as it would ensure that the .nvmrc is present
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.
Not really, it is not necessary here as the repo is already checked-out in the step before. Also we are only just reading out the
.nvmrcand making the version within available in the environment.