From dc85389f0c3cc24bf48076c2cac0cc5b5f628cd5 Mon Sep 17 00:00:00 2001 From: Petra Jaros Date: Tue, 28 Jan 2025 11:07:15 -0500 Subject: [PATCH] Use Nx for CI --- .github/workflows/access-client.yml | 40 -------------- .github/workflows/blob-index.yml | 37 ------------- .github/workflows/capabilities.yml | 34 ------------ .github/workflows/ci.yml | 32 +++++++++++ .github/workflows/cli.yml | 43 --------------- .github/workflows/did-mailto.yml | 37 ------------- .github/workflows/filecoin-api.yml | 49 ----------------- .github/workflows/filecoin-client.yml | 39 ------------- .github/workflows/upload-api.yml | 79 --------------------------- .github/workflows/upload-client.yml | 39 ------------- .github/workflows/w3up-client.yml | 44 --------------- 11 files changed, 32 insertions(+), 441 deletions(-) delete mode 100644 .github/workflows/access-client.yml delete mode 100644 .github/workflows/blob-index.yml delete mode 100644 .github/workflows/capabilities.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/cli.yml delete mode 100644 .github/workflows/did-mailto.yml delete mode 100644 .github/workflows/filecoin-api.yml delete mode 100644 .github/workflows/filecoin-client.yml delete mode 100644 .github/workflows/upload-api.yml delete mode 100644 .github/workflows/upload-client.yml delete mode 100644 .github/workflows/w3up-client.yml diff --git a/.github/workflows/access-client.yml b/.github/workflows/access-client.yml deleted file mode 100644 index 80c1da4c7..000000000 --- a/.github/workflows/access-client.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Access Client -env: - CI: true - FORCE_COLOR: 1 -on: - push: - branches: - - main - paths: - - 'packages/access-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/access-client.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/access-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/access-client.yml' - - 'pnpm-lock.yaml' -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 18 - - 20 - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - cache: 'pnpm' - - run: pnpm install - - run: pnpm run build - - run: pnpm -r --filter @storacha/access run lint - - run: pnpm -r --filter @storacha/access run test - - run: pnpm -r --filter @storacha/access exec depcheck - - run: pnpm --filter '@storacha/access' attw diff --git a/.github/workflows/blob-index.yml b/.github/workflows/blob-index.yml deleted file mode 100644 index 27312f9e8..000000000 --- a/.github/workflows/blob-index.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: blob-index -on: - push: - branches: - - main - paths: - - 'packages/blob-index/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/blob-index.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/blob-index/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/blob-index.yml' - - 'pnpm-lock.yaml' -jobs: - test: - name: Test - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/blob-index - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install - uses: pnpm/action-setup@v4 - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - run: pnpm --filter '@storacha/blob-index...' install - - run: pnpm --filter '@storacha/blob-index' lint - - run: pnpm --filter '@storacha/blob-index' test diff --git a/.github/workflows/capabilities.yml b/.github/workflows/capabilities.yml deleted file mode 100644 index eabfd8ead..000000000 --- a/.github/workflows/capabilities.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Capabilities -env: - CI: true - FORCE_COLOR: 1 -on: - push: - branches: - - main - paths: - - 'packages/capabilities/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/capabilities.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/capabilities/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/capabilities.yml' - - 'pnpm-lock.yaml' -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'pnpm' - - run: pnpm install - - run: pnpm run build - - run: pnpm -r --filter @storacha/capabilities run lint - - run: pnpm -r --filter @storacha/capabilities run test - - run: pnpm -r --filter @storacha/capabilities exec depcheck diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..186a39074 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI +on: + push: + branches: + - main + pull_request: + +# Needed for nx-set-shas when run on the main branch +permissions: + actions: read + contents: read + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # Fetch full history so `nx affected` can determine what to run + fetch-depth: 0 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + + # Set the base and head that `nx affected` will use + - uses: nrwl/nx-set-shas@v4 + + # Run CI tasks over all affected projects + - run: npx nx affected -t typecheck lint build test depcheck attw diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml deleted file mode 100644 index 4e662157c..000000000 --- a/.github/workflows/cli.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: cli -on: - push: - branches: - - main - paths: - - 'packages/cli/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/cli.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/cli/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/cli.yml' - - 'pnpm-lock.yaml' -jobs: - test: - name: Test - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 18 - - 20 - defaults: - run: - working-directory: ./packages/cli - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install - uses: pnpm/action-setup@v4 - - name: Setup - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node_version }} - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - run: pnpm install - - run: pnpm -r --filter @storacha/cli run lint - - run: pnpm -r --filter @storacha/cli run check - - run: pnpm -r --filter @storacha/cli run test diff --git a/.github/workflows/did-mailto.yml b/.github/workflows/did-mailto.yml deleted file mode 100644 index 452d8cb0b..000000000 --- a/.github/workflows/did-mailto.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: did-mailto -on: - push: - branches: - - main - paths: - - 'packages/did-mailto/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/did-mailto.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/did-mailto/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/did-mailto.yml' - - 'pnpm-lock.yaml' -jobs: - test: - name: Test - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/did-mailto - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install - uses: pnpm/action-setup@v4 - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - run: pnpm --filter '@storacha/did-mailto...' install - - run: pnpm --filter '@storacha/did-mailto' lint - - run: pnpm --filter '@storacha/did-mailto' test diff --git a/.github/workflows/filecoin-api.yml b/.github/workflows/filecoin-api.yml deleted file mode 100644 index 99fb63ce1..000000000 --- a/.github/workflows/filecoin-api.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Filecoin API -env: - CI: true - FORCE_COLOR: 1 -on: - workflow_dispatch: - push: - branches: - - main - paths: - - 'packages/filecoin-api/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/filecoin-api.yml' - - 'pnpm-lock.yaml' - - '.env.tpl' - pull_request: - paths: - - 'packages/filecoin-api/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/filecoin-api.yml' - - 'pnpm-lock.yaml' - - '.env.tpl' -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install - uses: pnpm/action-setup@v4 - - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - - name: Build - run: | - pnpm install - pnpm run --if-present build - - - name: Lint - run: pnpm -r --filter @storacha/filecoin-api run lint - - name: Test - run: pnpm -r --filter @storacha/filecoin-api run test diff --git a/.github/workflows/filecoin-client.yml b/.github/workflows/filecoin-client.yml deleted file mode 100644 index fbb5a49e6..000000000 --- a/.github/workflows/filecoin-client.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Filecoin Client -env: - CI: true - FORCE_COLOR: 1 -on: - push: - branches: - - main - paths: - - 'packages/filecoin-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/filecoin-client.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/filecoin-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/filecoin-client.yml' - - 'pnpm-lock.yaml' -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 18 - - 20 - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - cache: 'pnpm' - - run: pnpm install - - run: pnpm run build - - run: pnpm -r --filter @storacha/filecoin-client run lint - - run: pnpm -r --filter @storacha/filecoin-client run test - - run: pnpm -r --filter @storacha/filecoin-client run attw diff --git a/.github/workflows/upload-api.yml b/.github/workflows/upload-api.yml deleted file mode 100644 index eb95c7731..000000000 --- a/.github/workflows/upload-api.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Upload API -env: - CI: true - FORCE_COLOR: 1 -on: - workflow_dispatch: - push: - branches: - - main - paths: - - 'packages/upload-api/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/upload-api.yml' - - 'pnpm-lock.yaml' - - '.env.tpl' - pull_request: - paths: - - 'packages/upload-api/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/upload-api.yml' - - 'pnpm-lock.yaml' - - '.env.tpl' -jobs: - check: - name: Typecheck - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install - uses: pnpm/action-setup@v4 - - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - - name: Prepare - run: pnpm install - - - name: Build - run: | - pnpm install - pnpm run --if-present build - - - name: Check - uses: gozala/typescript-error-reporter-action@v1.0.8 - with: - project: packages/upload-api/tsconfig.json - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install - uses: pnpm/action-setup@v4 - - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - - name: Build - run: | - pnpm install - pnpm run --if-present build - - - name: Test - run: pnpm -r --filter @storacha/upload-api run test - - - name: Dependency check - run: pnpm -r --filter @storacha/upload-api exec depcheck diff --git a/.github/workflows/upload-client.yml b/.github/workflows/upload-client.yml deleted file mode 100644 index c5e452c42..000000000 --- a/.github/workflows/upload-client.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Upload Client -env: - CI: true - FORCE_COLOR: 1 -on: - push: - branches: - - main - paths: - - 'packages/upload-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/client.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/upload-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/client.yml' - - 'pnpm-lock.yaml' -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 18 - - 20 - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - cache: 'pnpm' - - run: pnpm install - - run: pnpm run build - - run: pnpm -r --filter @storacha/upload-client run lint - - run: pnpm -r --filter @storacha/upload-client run test - - run: pnpm -r --filter @storacha/upload-client exec depcheck diff --git a/.github/workflows/w3up-client.yml b/.github/workflows/w3up-client.yml deleted file mode 100644 index 5d11703d6..000000000 --- a/.github/workflows/w3up-client.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: client -on: - push: - branches: - - main - paths: - - 'packages/w3up-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/w3up-client.yml' - - 'pnpm-lock.yaml' - pull_request: - paths: - - 'packages/w3up-client/**' - - 'packages/eslint-config-w3up/**' - - '.github/workflows/w3up-client.yml' - - 'pnpm-lock.yaml' -jobs: - test: - name: Test - runs-on: ubuntu-latest - strategy: - matrix: - node_version: - - 18 - - 20 - defaults: - run: - working-directory: ./packages/w3up-client - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install - uses: pnpm/action-setup@v4 - - name: Setup - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - registry-url: https://registry.npmjs.org/ - cache: 'pnpm' - - run: pnpm --filter '@storacha/client...' install - - run: pnpm --filter '@storacha/client' attw - - uses: ./packages/w3up-client/.github/actions/test - with: - w3up-client-dir: ./packages/w3up-client/