Skip to content

Commit

Permalink
ci: Separate jobs for docs linting and building (#22798)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jun 15, 2023
1 parent f648444 commit 5dadd5b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-node/action.yml
Expand Up @@ -74,7 +74,7 @@ runs:
- name: Generate files
shell: bash
run: >
if [ -d lib ]; then
if [[ -d lib ]]; then
yarn prepare:generate;
fi
Expand Down
61 changes: 48 additions & 13 deletions .github/workflows/build.yml
Expand Up @@ -210,7 +210,7 @@ jobs:
- name: Lint
run: yarn prettier --cache-location .prettier-cache

lint-other:
lint-docs:
needs: [setup]
runs-on: ubuntu-latest
timeout-minutes: 7
Expand All @@ -228,18 +228,33 @@ jobs:
- name: Lint markdown
uses: DavidAnson/markdownlint-cli2-action@bb4bb94c73936643d73d345b48fead3e96f90a5e # v10.0.1

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

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

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

- name: Lint website docs
run: yarn -s lint-website-docs

lint-other:
needs: [setup]
runs-on: ubuntu-latest
timeout-minutes: 7

steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

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

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

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

- name: Test schema
run: yarn test-schema

Expand Down Expand Up @@ -376,6 +391,30 @@ jobs:
name: renovate-package
path: renovate-v0.0.0-semantic-release.tgz

build-docs:
needs: [setup, lint-docs]
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.draft != true
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

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

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

- name: Upload
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: docs
path: tmp/docs/

test-e2e:
needs: [setup, build]
runs-on: 'ubuntu-latest'
Expand Down Expand Up @@ -408,9 +447,11 @@ jobs:
- setup
- lint-eslint
- lint-prettier
- lint-docs
- lint-other
- test-e2e
- test-success
- build-docs
- codecov

if: github.repository == 'renovatebot/renovate' && github.event_name != 'pull_request'
Expand Down Expand Up @@ -450,9 +491,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Upload docs
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: docs
path: tmp/docs/

0 comments on commit 5dadd5b

Please sign in to comment.