ci: init refactor #7
Workflow file for this run
This file contains hidden or 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: Build and deploy contracts | |
| on: | |
| pull_request: | |
| branches: | |
| - '*' | |
| jobs: | |
| detect-changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| sdk: ${{ steps.changed-files.outputs.sdk_changed }} | |
| smart_contract: ${{ steps.changed-files.outputs.smart_contract_changed }} | |
| subgraph: ${{ steps.changed-files.outputs.subgraph_changed }} | |
| dapp: ${{ steps.changed-files.outputs.dapp_changed }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect package changes | |
| id: changed-files | |
| uses: tj-actions/changed-files@v45 | |
| with: | |
| files_yaml: | | |
| dataprotector-deserializer: | |
| - 'packages/dataprotector-deserializer/**' | |
| protected-data-delivery-dapp: | |
| - 'packages/protected-data-delivery-dapp/**' | |
| sdk: | |
| - 'packages/sdk/**' | |
| sharing-smart-contract: | |
| - 'packages/smart-contract/**' | |
| smart-contract: | |
| - 'packages/smart-contract/**' | |
| subgraph: | |
| - 'packages/subgraph/**' | |
| matrix: true | |
| build-and-test: | |
| name: Build & Test Modified Packages | |
| needs: detect-changes | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: [ sdk, smart_contract, subgraph, dapp ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies and run tests for ${{ matrix.package }} | |
| working-directory: packages/${{ matrix.package }} | |
| run: | | |
| npm ci | |
| npm run test |