Refactor and advance core framework capabilities #9
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: main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install dependencies | |
run: yarn | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files_yaml: | | |
contracts: | |
- packages/contracts/**/*.{js,json,ts,sol} | |
docs: | |
- apps/docs/**/* | |
packages: | |
- packages/**/*.{js,json,ts} | |
- '!packages/{contracts}/**/*' | |
to_format: | |
- '**/*.{cjs,js,json,jsx,md,mdx,sol,ts,tsx,yaml,yml}' | |
to_lint: | |
- '**/*.{cjs,js,jsx,ts,tsx}' | |
- if: steps.changed-files.outputs.contracts_any_changed == 'true' | |
name: Compile and lint contracts | |
run: | | |
yarn compile:contracts | |
yarn workspace excubiae-contracts lint | |
- if: steps.changed-files.outputs.docs_any_changed == 'true' | |
name: Build and format docs | |
run: | | |
yarn workspace excubiae-docs build | |
yarn workspace excubiae-docs format | |
- if: steps.changed-files.outputs.packages_any_changed == 'true' | |
name: Build packages | |
run: yarn build:packages | |
- if: steps.changed-files.outputs.to_format_any_changed == 'true' | |
name: Format | |
run: yarn run prettier --check --ignore-unknown --no-error-on-unmatched-pattern ${{ steps.changed-files.outputs.to_format_all_changed_files }} | |
- if: steps.changed-files.outputs.to_lint_any_changed == 'true' | |
name: Run Eslint | |
run: yarn run eslint ${{ steps.changed-files.outputs.to_lint_all_changed_files }} --ext .cjs,.js,.jsx,.ts,.tsx | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install dependencies | |
run: yarn | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files_yaml: | | |
contracts: | |
- packages/contracts/**/*.{js,json,ts,sol} | |
- if: steps.changed-files.outputs.contracts_any_changed == 'true' | |
name: Build and Test contracts | |
run: | | |
yarn compile:contracts | |
yarn test:contracts |