|
| 1 | +name: Test Build (Branch) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - test-aarch64-linux-target |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - test-aarch64-linux-target |
| 10 | + |
| 11 | +jobs: |
| 12 | + test_build: |
| 13 | + name: Test NIF ${{ matrix.nif }} - ${{ matrix.job.target }} (${{ matrix.job.os }}) |
| 14 | + runs-on: ${{ matrix.job.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + nif: ["2.15"] |
| 19 | + job: |
| 20 | + - { target: aarch64-apple-darwin, os: macos-latest } |
| 21 | + - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } |
| 22 | + - { |
| 23 | + target: aarch64-unknown-linux-gnu, |
| 24 | + os: ubuntu-latest, |
| 25 | + use-cross: true, |
| 26 | + } |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Checkout source code |
| 30 | + uses: actions/checkout@v3 |
| 31 | + with: |
| 32 | + submodules: recursive |
| 33 | + |
| 34 | + - name: Extract crate information |
| 35 | + shell: bash |
| 36 | + run: | |
| 37 | + # Get the project version from mix.exs |
| 38 | + echo "PROJECT_VERSION=$(sed -n 's/^ @version "\(.*\)"/\1/p' mix.exs | head -n1)" >> $GITHUB_ENV |
| 39 | +
|
| 40 | + - name: Install Rust toolchain |
| 41 | + uses: dtolnay/rust-toolchain@stable |
| 42 | + with: |
| 43 | + target: ${{ matrix.job.target }} |
| 44 | + |
| 45 | + - name: Build the project |
| 46 | + id: build-crate |
| 47 | + |
| 48 | + with: |
| 49 | + nif-version: ${{ matrix.nif }} |
| 50 | + project-dir: "native/baml_elixir" |
| 51 | + project-name: baml_elixir |
| 52 | + project-version: ${{ env.PROJECT_VERSION }} |
| 53 | + target: ${{ matrix.job.target }} |
| 54 | + use-cross: ${{ matrix.job.use-cross }} |
| 55 | + |
| 56 | + - name: Verify build artifact |
| 57 | + run: | |
| 58 | + echo "Build completed successfully for target: ${{ matrix.job.target }}" |
| 59 | + echo "Artifact path: ${{ steps.build-crate.outputs.file-path }}" |
| 60 | + echo "File name: ${{ steps.build-crate.outputs.file-name }}" |
| 61 | + ls -la "${{ steps.build-crate.outputs.file-path }}" |
0 commit comments