diff --git a/.github/actions/build-sandbox-template/action.yml b/.github/actions/build-sandbox-template/action.yml index c4aee77de9..16b9241d14 100644 --- a/.github/actions/build-sandbox-template/action.yml +++ b/.github/actions/build-sandbox-template/action.yml @@ -10,6 +10,15 @@ runs: KERNEL_VERSION: "vmlinux-6.1.158" FIRECRACKER_VERSION: "v1.12.1_a41d3fb" run: | + echo "--- which go:" + which go + echo "--- go version:" + go version + echo "--- go env:" + go env + echo "--- env:" + env + # Generate an unique build ID for the template for this run export BUILD_ID=$(uuidgen) @@ -18,7 +27,7 @@ runs: echo "TESTS_SANDBOX_TEMPLATE_ID=${TEMPLATE_ID}" >> .env.test echo "TESTS_SANDBOX_BUILD_ID=${BUILD_ID}" >> .env.test - sudo -E make -C packages/orchestrator build-template \ + make -C packages/orchestrator build-template \ ARTIFACTS_REGISTRY_PROVIDER=Local \ STORAGE_PROVIDER=Local \ TEMPLATE_ID=${TEMPLATE_ID} \ diff --git a/.github/actions/deploy-setup/action.yml b/.github/actions/deploy-setup/action.yml index 1982428fae..f4325a8d80 100644 --- a/.github/actions/deploy-setup/action.yml +++ b/.github/actions/deploy-setup/action.yml @@ -55,7 +55,7 @@ runs: uses: google-github-actions/setup-gcloud@v2 - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 + uses: hashicorp/setup-terraform@v4 with: terraform_version: 1.5.7 diff --git a/.github/actions/host-init/init-client.sh b/.github/actions/host-init/init-client.sh index 7db6c681b9..97432f7286 100644 --- a/.github/actions/host-init/init-client.sh +++ b/.github/actions/host-init/init-client.sh @@ -75,7 +75,7 @@ mkdir -p /fc-vm envd_dir="/fc-envd" mkdir -p $envd_dir -cp packages/envd/bin/debug/envd "${envd_dir}/." +cp packages/envd/bin/envd "${envd_dir}/." chmod -R 755 $envd_dir ls -lh $envd_dir diff --git a/.github/workflows/auto-request-same-site.yml b/.github/workflows/auto-request-same-site.yml index 15d9138dbd..49d8175ba2 100644 --- a/.github/workflows/auto-request-same-site.yml +++ b/.github/workflows/auto-request-same-site.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Get GitHub App installation token id: app - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v3 with: app-id: ${{ secrets.E2B_GH_APP_AUTO_REQUEST_SAME_SITE_APP_ID }} private-key: ${{ secrets.E2B_GH_APP_AUTO_REQUEST_SAME_SITE_APP_PRIVATE_KEY }} diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index af27a2ae71..2fa19f49a0 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -19,12 +19,36 @@ jobs: - name: Checkout Code uses: actions/checkout@v5 - - name: Build Packages - uses: ./.github/actions/build-packages + - name: Download packages + uses: actions/download-artifact@v8 + with: + merge-multiple: 'true' + + - name: Move packages back where the run scripts expect them to be + run: | + for f in api client-proxy envd orchestrator; do + mkdir -p "./packages/$f/bin" + mv "$f" "./packages/$f/bin/$f" + done - name: Initialize Host uses: ./.github/actions/host-init + - name: Setup Go + uses: ./.github/actions/go-setup-cache + with: + cache-dependency-paths: | + go.work + packages/orchestrator/go.mod + packages/orchestrator/go.sum + tests/integration/go.mod + tests/integration/go.sum + + - name: Debug + run: | + which go + go version + - name: Build Template uses: ./.github/actions/build-sandbox-template diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6d9b969d69..12925ac466 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: uses: wistia/parse-tool-versions@v2.1.1 - name: golangci-lint ${{ matrix.modules }} - uses: golangci/golangci-lint-action@v8 + uses: golangci/golangci-lint-action@v9 with: version: "v${{ env.GOLANGCI_LINT }}" working-directory: ${{ matrix.modules }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 0000000000..32ff55c66c --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,37 @@ +name: Build all packages + +on: + workflow_call: + +permissions: + contents: read + +jobs: + build-package: + runs-on: ubuntu-24.04 + strategy: + matrix: + package: + - name: orchestrator + - name: api + - name: envd + - name: client-proxy + + steps: + - uses: actions/checkout@v6 + + - name: Setup Go + uses: ./.github/actions/go-setup-cache + with: + cache-dependency-paths: | + go.work + packages/${{ matrix.package.name }}/go.mod + packages/${{ matrix.package.name }}/go.sum + + - name: Build package + run: make -C packages/${{ matrix.package.name }} build-debug + + - uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.package.name }}-build + path: packages/${{ matrix.package.name }}/bin/${{ matrix.package.name }} diff --git a/.github/workflows/pr-no-generated-changes.yml b/.github/workflows/pr-no-generated-changes.yml index f4fd88d5aa..09f0edcb05 100644 --- a/.github/workflows/pr-no-generated-changes.yml +++ b/.github/workflows/pr-no-generated-changes.yml @@ -25,7 +25,7 @@ jobs: - name: Generate GitHub App installation token id: app-token if: ${{ inputs.commit == true }} - uses: actions/create-github-app-token@v2 + uses: actions/create-github-app-token@v3 with: app-id: ${{ secrets.app_id }} private-key: ${{ secrets.app_secret }} @@ -47,7 +47,7 @@ jobs: - name: Setup Go uses: ./.github/actions/go-setup-cache - - uses: hashicorp/setup-terraform@v3 + - uses: hashicorp/setup-terraform@v4 with: terraform_version: "${{ env.TERRAFORM }}" diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index d9b8f23621..c8ec24521a 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -97,7 +97,7 @@ jobs: uses: wistia/parse-tool-versions@v2.1.1 - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 + uses: hashicorp/setup-terraform@v4 with: terraform_version: "${{ env.TERRAFORM }}" diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a3af82a46a..ed813277d4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -28,8 +28,10 @@ jobs: uses: ./.github/workflows/out-of-order-migrations.yml unit-tests: uses: ./.github/workflows/pr-tests.yml + build: + uses: ./.github/workflows/pr-build.yml integration-tests: - needs: [out-of-order-migrations] + needs: [out-of-order-migrations, build] uses: ./.github/workflows/integration_tests.yml with: # Only publish the results for same-repo PRs diff --git a/packages/envd/Makefile b/packages/envd/Makefile index f073d37ae7..d7bd076cde 100644 --- a/packages/envd/Makefile +++ b/packages/envd/Makefile @@ -23,7 +23,7 @@ build: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/envd ${LDFLAGS} build-debug: - CGO_ENABLED=1 go build -race -gcflags=all="-N -l" -o bin/debug/envd ${LDFLAGS} + CGO_ENABLED=1 go build -race -gcflags=all="-N -l" -o bin/envd ${LDFLAGS} start-docker: make build diff --git a/packages/orchestrator/Makefile b/packages/orchestrator/Makefile index 94da7d669b..fb5ef4570d 100644 --- a/packages/orchestrator/Makefile +++ b/packages/orchestrator/Makefile @@ -112,6 +112,15 @@ test-docker: .PHONY: build-template build-template: + echo "--- which go:" + which go + echo "--- go version:" + go version + echo "--- go env:" + go env + echo "--- env:" + env + TEMPLATE_BUCKET_NAME=$(TEMPLATE_BUCKET_NAME) \ GOOGLE_SERVICE_ACCOUNT_BASE64=$(GOOGLE_SERVICE_ACCOUNT_BASE64) \ DOCKER_AUTH_BASE64=$(DOCKER_AUTH_BASE64) \