Skip to content

Commit

Permalink
ci(gh-actions): migrate steps to use nx instead of lerna / yarn works…
Browse files Browse the repository at this point in the history
…paces
  • Loading branch information
jackw committed Jun 1, 2023
1 parent 40ac24e commit 0811027
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- name: Setup .npmrc file for NPM registry
uses: actions/setup-node@v3
with:
Expand All @@ -21,27 +23,27 @@ jobs:
- name: Install dependencies
run: yarn install --immutable --prefer-offline
- name: Check types
run: yarn typecheck
run: yarn nx affected -t typecheck --parallel
- name: Lint
run: yarn lint
run: yarn nx affected -t lint --parallel
- name: Unit tests
run: yarn test:ci
run: yarn nx affected -t test --ci
- name: Build all packages
run: yarn build

- name: '@grafana/create-plugin - test an app plugin generation'
run: yarn workspace @grafana/create-plugin run generate-app && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-app && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test an app with backend plugin generation'
run: yarn workspace @grafana/create-plugin run generate-app-backend && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-app-backend && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test panel plugin generation'
run: yarn workspace @grafana/create-plugin run generate-panel && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-panel && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test datasource plugin generation'
run: yarn workspace @grafana/create-plugin run generate-datasource && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-datasource && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test datasource with backend plugin generation'
run: yarn workspace @grafana/create-plugin run generate-datasource-backend && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-datasource-backend && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test scenes app plugin generation'
run: yarn workspace @grafana/create-plugin run generate-scenes-app && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
run: yarn nx run @grafana/create-plugin:generate-scenes-app && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)

- name: '@grafana/sign-plugin - build'
run: yarn workspace @grafana/sign-plugin run build
- name: '@grafana/sign-plugin - sign generated plugin'
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable --prefer-offline
- name: Build documentation website
run: yarn workspace website run build
run: yarn docs:build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
paths:
- '.github/workflows/deploy.yml'
- '.github/workflows/test-deploy.yml'
- '.github/workflows/test-build.yml'
- 'docusaurus/**'

jobs:
Expand All @@ -26,4 +26,4 @@ jobs:
- name: Install dependencies
run: yarn install --immutable --prefer-offline
- name: Build documentation website
run: yarn workspace website run build
run: yarn docs:build

0 comments on commit 0811027

Please sign in to comment.