Skip to content
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

feat: add plural support #6

Merged
merged 14 commits into from
Jan 23, 2024
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
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions .devcontainer/devcontainer.json

This file was deleted.

10 changes: 0 additions & 10 deletions .devcontainer/post-create.sh

This file was deleted.

5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
.gitignore
*.md
dist
2 changes: 1 addition & 1 deletion .github/actions/calculate-prefetch-matrix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
- name: Calculate cache keys
id: cache-keys
env:
HASH: ${{ hashFiles('pnpm-lock.yaml') }}
HASH: ${{ hashFiles('yarn.lock') }}
shell: bash
run: |
echo 'MACOS_KEY=node_modules-macOS-${{ inputs.node-version }}-${{ env.HASH }}' >> "$GITHUB_ENV"
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
}}-${{
inputs.node-version
}}-${{
hashFiles('pnpm-lock.yaml')
hashFiles('yarn.lock')
}}' >> "$GITHUB_ENV"

- name: Restore `node_modules`
Expand All @@ -55,15 +55,15 @@ runs:
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: ${{ inputs.node-version }}
cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }}
cache: ${{ env.CACHE_HIT != 'true' && 'yarn' || '' }}

- name: Install dependencies
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
if: env.CACHE_HIT != 'true'
with:
timeout_minutes: 10
max_attempts: 3
command: pnpm install --frozen-lockfile
command: yarn workspaces focus

- name: Write `node_modules` cache
if: inputs.save-cache == 'true' && env.CACHE_HIT != 'true'
Expand All @@ -77,7 +77,7 @@ runs:
shell: bash
run: >
if [[ -d lib ]]; then
pnpm prepare:generate;
yarn prepare:generate;
fi

- name: Git config
Expand Down
93 changes: 22 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ env:
data/
tools/
package.json
pnpm-lock.yaml
yarn.lock
.yarnrc.yml
codecov.yml

jobs:
Expand Down Expand Up @@ -121,7 +122,7 @@ jobs:
FILTER_SHARDS: ${{ github.event.pull_request.draft && 'true' || '' }}
CHANGED_FILES: ${{ steps.changed-files.outputs.changed-files }}
run: |
echo "$(pnpm -s schedule-test-shards)" >> "$GITHUB_OUTPUT"
echo "$(yarn schedule-test-shards)" >> "$GITHUB_OUTPUT"

prefetch:
needs: [setup]
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
key: eslint-main-cache

- name: Lint
run: pnpm eslint-ci
run: yarn eslint-ci

- name: Remove cache
if: github.event_name == 'push'
Expand Down Expand Up @@ -230,7 +231,7 @@ jobs:
key: prettier-main-cache

- name: Lint
run: pnpm prettier --cache-location .cache/prettier
run: yarn prettier --cache-location .cache/prettier

- name: Remove cache
if: github.event_name == 'push'
Expand Down Expand Up @@ -267,13 +268,13 @@ jobs:
uses: DavidAnson/markdownlint-cli2-action@455b6612a7b7a80f28be9e019b70abdd11696e4e # v14.0.0

- name: Lint fenced code blocks
run: pnpm doc-fence-check
run: yarn doc-fence-check

- name: Lint documentation
run: pnpm lint-documentation
run: yarn lint-documentation

- name: Markdown lint
run: pnpm markdown-lint
run: yarn markdown-lint

lint-other:
needs: [setup]
Expand All @@ -291,16 +292,16 @@ jobs:
os: ${{ runner.os }}

- name: Type check
run: pnpm type-check
run: yarn type-check

- name: Lint project file structure
run: pnpm ls-lint
run: yarn ls-lint

- name: Check git version
run: pnpm git-check
run: yarn git-check

- name: Test schema
run: pnpm test-schema
run: yarn test-schema

test:
needs: [setup, prefetch]
Expand Down Expand Up @@ -337,7 +338,7 @@ jobs:
}}-${{
env.NODE_VERSION
}}-${{
hashFiles('pnpm-lock.yaml')
hashFiles('yarn.lock')
}}-${{
matrix.cache-key
}}
Expand All @@ -347,7 +348,7 @@ jobs:
run: |
for shard in ${{ matrix.shards }};
do
TEST_SHARD="$shard" pnpm jest \
TEST_SHARD="$shard" yarn jest \
--ci \
--test-timeout ${{ matrix.test-timeout-milliseconds }} \
--coverage ${{ matrix.coverage }}
Expand Down Expand Up @@ -402,14 +403,14 @@ jobs:
os: ${{ runner.os }}

- name: Merge coverage reports
run: pnpm nyc merge ./coverage/json ./coverage/nyc/coverage.json
run: yarn nyc merge ./coverage/json ./coverage/nyc/coverage.json

- name: Report coverage
run: pnpm nyc report -t ./coverage/nyc --skip-full -r text -r text-summary
run: yarn nyc report -t ./coverage/nyc --skip-full -r text -r text-summary

- name: Check coverage threshold
run: |
pnpm nyc check-coverage -t ./coverage/nyc \
yarn nyc check-coverage -t ./coverage/nyc \
--branches 100 \
--functions 100 \
--lines 100 \
Expand Down Expand Up @@ -464,10 +465,10 @@ jobs:
os: ${{ runner.os }}

- name: Build
run: pnpm build
run: yarn build

- name: Pack
run: pnpm test-e2e:pack
run: yarn test-e2e:pack

- name: Upload
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand All @@ -491,7 +492,7 @@ jobs:
os: ${{ runner.os }}

- name: Build
run: pnpm build:docs
run: yarn build:docs

- name: Upload
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down Expand Up @@ -525,57 +526,7 @@ jobs:
name: renovate-package

- name: Install dependencies
run: pnpm test-e2e:install
run: yarn test-e2e:install

- name: E2E Test
run: pnpm test-e2e:run

release:
needs:
- setup
- lint-eslint
- lint-prettier
- lint-docs
- lint-other
- test-e2e
- test-success
- build-docs
- coverage

if: github.repository == 'renovatebot/renovate' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
issues: write
pull-requests: write

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # zero stands for full checkout, which is required for semantic-release

- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}

- name: Check dry run
run: |
if [[ "${{github.event_name}}" == "workflow_dispatch" && "${{ github.event.inputs.dryRun }}" != "true" ]]; then
echo "DRY_RUN=false" >> "$GITHUB_ENV"
elif [[ "${{github.ref}}" == "refs/heads/${{env.DEFAULT_BRANCH}}" ]]; then
echo "DRY_RUN=false" >> "$GITHUB_ENV"
elif [[ "${{github.ref}}" =~ ^refs/heads/v[0-9]+(\.[0-9]+)?$ ]]; then
echo "DRY_RUN=false" >> "$GITHUB_ENV"
fi

- name: semantic-release
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ./.npmrc
pnpm semantic-release --dry-run ${{env.DRY_RUN}}
git checkout -- .npmrc
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn test-e2e:run
39 changes: 39 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Bump
on:
push:
branches:
- main

jobs:
build:
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.draft != true
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION }}
os: ${{ runner.os }}

- name: Build
run: yarn build

bump:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Bumping version
uses: jpb06/[email protected]
with:
major-keywords: BREAKING CHANGE
minor-keywords: feat,minor
patch-keywords: fix,chore
should-default-to-patch: true
15 changes: 0 additions & 15 deletions .github/workflows/dependency-review.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/devcontainer.yml

This file was deleted.

Loading
Loading