forked from changesets/changesets
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to GitHub Actions (changesets#1085)
* Migrate to GitHub Actions * Include the install step in all jobs * add missing shell param in the composite action * Pass `--color` to Jest * Bring back setting up a mock git user * Bump `codecov/codecov-action` * limit push runs * drop the prepare-cache step * add ci-ok job * update codecov action
- Loading branch information
Showing
6 changed files
with
96 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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,14 @@ | ||
name: Setup CI | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: yarn install --frozen-lockfile |
This file contains 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 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,69 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/ci-setup | ||
|
||
- name: Check Git version | ||
run: git --version | ||
|
||
- name: Setup mock Git user | ||
run: git config --global user.email "[email protected]" && git config --global user.name "Your Name" | ||
|
||
- name: Jest tests | ||
run: yarn jest --ci --color --runInBand --coverage --reporters=default --reporters=jest-junit | ||
|
||
- name: Upload coverage | ||
uses: codecov/codecov-action@v4 | ||
|
||
typecheck: | ||
name: Typecheck | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/ci-setup | ||
|
||
- name: Typecheck | ||
run: yarn types:check | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/ci-setup | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
ci-ok: | ||
name: CI OK | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [test, typecheck, lint] | ||
env: | ||
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }} | ||
steps: | ||
- name: Check for failure | ||
run: | | ||
echo $FAILURE | ||
if [ "$FAILURE" = "false" ]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
This file contains 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.