Skip to content

Commit

Permalink
ci: Restore compilation check on PR (#4963)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
SevInf authored Jul 23, 2024
1 parent ff166c7 commit a6977e5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-engines-react-native-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -46,6 +50,7 @@ jobs:
ls -la .
- uses: actions/upload-artifact@v4
if: ${{ inputs.uploadArtifacts }}
with:
name: ios
path: |
Expand Down Expand Up @@ -90,6 +95,7 @@ jobs:
ls -la .
- uses: actions/upload-artifact@v4
if: ${{ inputs.uploadArtifacts }}
with:
name: android
path: |
Expand Down
44 changes: 31 additions & 13 deletions .github/workflows/test-compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file.

0 comments on commit a6977e5

Please sign in to comment.