From a6977e518975c6a4e6ae77bf7faf8afc08b97e7d Mon Sep 17 00:00:00 2001 From: Serhii Tatarintsev Date: Tue, 23 Jul 2024 10:27:39 +0200 Subject: [PATCH] ci: Restore compilation check on PR (#4963) * ci: Restore compilation check on PR Restore macos/windows compilation check on pull requests and add react native as well. * Trigger build * Add cache, name * Speed up check * Remove clean * Run in bash even on windows * Cleanup --- .../build-engines-react-native-template.yml | 6 +++ .github/workflows/test-compilation.yml | 44 +++++++++++++------ query-engine/query-engine-node-api/tmp | 0 3 files changed, 37 insertions(+), 13 deletions(-) delete mode 100644 query-engine/query-engine-node-api/tmp diff --git a/.github/workflows/build-engines-react-native-template.yml b/.github/workflows/build-engines-react-native-template.yml index 610901b2d03..09cf6f6858b 100644 --- a/.github/workflows/build-engines-react-native-template.yml +++ b/.github/workflows/build-engines-react-native-template.yml @@ -7,6 +7,10 @@ on: description: 'Commit on the given branch to build' type: string required: false + uploadArtifacts: + description: If the job should upload artifacts after build finishes + type: boolean + default: true jobs: build-ios: @@ -46,6 +50,7 @@ jobs: ls -la . - uses: actions/upload-artifact@v4 + if: ${{ inputs.uploadArtifacts }} with: name: ios path: | @@ -90,6 +95,7 @@ jobs: ls -la . - uses: actions/upload-artifact@v4 + if: ${{ inputs.uploadArtifacts }} with: name: android path: | diff --git a/.github/workflows/test-compilation.yml b/.github/workflows/test-compilation.yml index b1d80995f26..3db71c67b5e 100644 --- a/.github/workflows/test-compilation.yml +++ b/.github/workflows/test-compilation.yml @@ -16,25 +16,43 @@ concurrency: jobs: test-crate-compilation: - name: "Check release compilation" + name: "${{ matrix.crate }} on ${{ matrix.os }}" strategy: fail-fast: false - runs-on: ubuntu-latest + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-13 + crate: + - schema-engine-cli + - prisma-fmt + - query-engine + - query-engine-node-api + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - run: "cargo clean && cargo build --release -p schema-engine-cli" - name: "Compile Migration Engine" - - - run: "cargo clean && cargo build --release -p prisma-fmt" - name: "Compile prisma-fmt" - - - run: "cargo clean && cargo build --release -p query-engine" - name: "Compile Query Engine Binary" - - - run: "cargo clean && cargo build --release -p query-engine-node-api" - name: "Compile Query Engine Library" + - name: compile ${{ matrix.crate }} + shell: bash + env: + CRATE: ${{ matrix.crate }} + run: cargo build --release -p "$CRATE" - name: "Check that Cargo.lock did not change" run: "git diff --exit-code" + + test-react-native-compilation: + name: React Native + uses: ./.github/workflows/build-engines-react-native-template.yml + with: + commit: ${{ github.sha }} + uploadArtifacts: false diff --git a/query-engine/query-engine-node-api/tmp b/query-engine/query-engine-node-api/tmp deleted file mode 100644 index e69de29bb2d..00000000000