diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..b2ab416 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,123 @@ +name: Cross-Repo Integration + +on: + pull_request: + push: + branches: [master] + workflow_dispatch: + +concurrency: + group: protocol-integration-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + package-protocol: + name: Package Protocol (tgz) + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup NodeJS + uses: actions/setup-node@v4 + with: + node-version: 24 + + - name: Install deps & build + run: | + npm ci + npm run build + + - name: Pack Protocol + run: npm pack + + - name: Upload Package + uses: actions/upload-artifact@v4 + with: + name: protocol-package + path: metacall-protocol-*.tgz + retention-days: 1 + + faas-tests: + name: Run FaaS Integration Tests + runs-on: ubuntu-latest + needs: package-protocol + steps: + - name: Setup NodeJs + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install MetaCall CLI + run: wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh + + - name: Checkout FaaS repo + uses: actions/checkout@v4 + with: + repository: metacall/faas + path: faas + + - name: Download Protocol Package + uses: actions/download-artifact@v4 + with: + name: protocol-package + path: faas/ + + - name: Install deps with local Protocol + working-directory: faas + run: | + npm i + npm uninstall @metacall/protocol + npm i ./metacall-protocol-*.tgz + + - name: Build FaaS + working-directory: faas + run: npm run build + + - name: Allow tgz in Docker build + working-directory: faas + run: echo '!*.tgz' >> .dockerignore + + - name: Run Integration tests + working-directory: faas + run: npm run integration + + deploy-tests: + name: Run Deploy Tests + runs-on: ubuntu-latest + needs: package-protocol + steps: + - name: Setup NodeJs + uses: actions/setup-node@v4 + with: + node-version: 24 + + - name: Install MetaCall CLI + run: wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh + + - name: Checkout Deploy repo + uses: actions/checkout@v4 + with: + repository: metacall/deploy + path: deploy + + - name: Download Protocol Package + uses: actions/download-artifact@v4 + with: + name: protocol-package + path: deploy/ + + - name: Install deps with local Protocol + working-directory: deploy + run: | + npm i + npm uninstall @metacall/protocol + npm i ./metacall-protocol-*.tgz + + - name: Build Deploy + working-directory: deploy + run: npm run build + + - name: Run unit tests + working-directory: deploy + run: npm run unit