diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index 221c427d..685cc3bc 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -23,6 +23,19 @@ jobs: with: version: 8 run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install packages run: | diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml new file mode 100644 index 00000000..a074572b --- /dev/null +++ b/.github/workflows/cli.yaml @@ -0,0 +1,52 @@ +on: + push: + paths: ['apps/cli/**', '.github/workflows/cli.yaml'] + pull_request: + paths: ['apps/cli/**'] + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:cli + + - name: Test + run: | + pnpm run test:cli + + diff --git a/.github/workflows/sdk-node.yaml b/.github/workflows/sdk-node.yaml new file mode 100644 index 00000000..27716230 --- /dev/null +++ b/.github/workflows/sdk-node.yaml @@ -0,0 +1,50 @@ +on: + push: + paths: ['packages/sdk-node/**', '.github/workflows/sdk-node.yaml'] + pull_request: + paths: ['packages/sdk-node'] + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:sdk-node + + - name: Test + run: | + pnpm run test:sdk-node diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index ba9412f8..1f3ce74d 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -24,6 +24,19 @@ jobs: version: 8 run_install: false + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install packages run: | pnpm i