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

Add Actions workflow to check commons for breaking changes #39

Merged
merged 11 commits into from
Aug 28, 2024
53 changes: 53 additions & 0 deletions .github/workflows/check-against-commons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Check for 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 }} repo
uses: actions/checkout@v4
with:
repository: api3dao/${{ env.repo_name }}
path: ${{ env.repo_name }}

# Workaround for inability clone outside of workspace directory
dcroote marked this conversation as resolved.
Show resolved Hide resolved
# See: https://github.com/actions/checkout/issues/197#issuecomment-603651324
- name: Move ${{ env.repo_name }} directory outside of eslint-plugin-commons repo
run: mv ${{ env.repo_name }} ../

- name: Install packaged eslint-plugin-commons 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 .