Add Actions workflow to check commons for breaking changes #9
Workflow file for this run
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
name: Check Breaking Changes | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
repo_name: commons | |
jobs: | |
check-breaking-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout eslint-plugin-commons | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install dependencies for eslint-plugin-commons | |
run: pnpm install | |
- name: Package eslint-plugin-commons | |
run: | | |
PACKAGE_PATH=$(pnpm pack | tail -n 1) | |
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV | |
- name: Checkout api3dao/${{ env.repo_name }} repository | |
uses: actions/checkout@v4 | |
with: | |
repository: api3dao/${{ env.repo_name }} | |
path: ${{ env.repo_name }} | |
- name: Move ${{ env.repo_name }} outside of the repo | |
run: mv ${{ env.repo_name }} ../ | |
- name: Install packaged version in ${{ env.repo_name }} | |
working-directory: ../${{ env.repo_name }} | |
run: | | |
pnpm add -D file:../eslint-plugin-commons/${{ env.PACKAGE_PATH }} | |
- name: Run ESLint on ${{ env.repo_name }} | |
working-directory: ../${{ env.repo_name }} | |
run: pnpm eslint . |