|
8 | 8 | jobs: |
9 | 9 | build: |
10 | 10 | runs-on: ubuntu-latest |
| 11 | + container: shivammathur/node:latest-${{ matrix.arch }} |
11 | 12 |
|
12 | 13 | strategy: |
13 | 14 | matrix: |
14 | | - php-version: [8.1] # Add more PHP versions as needed |
15 | | - arch: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu] |
| 15 | + php-version: [8.1] |
| 16 | + arch: [amd64, i386, aarch64] |
16 | 17 |
|
17 | 18 | steps: |
18 | 19 | - name: Checkout repository |
19 | 20 | uses: actions/checkout@v2 |
20 | 21 |
|
| 22 | + - name: Install dependencies |
| 23 | + run: sudo apt-get update && sudo apt-get install -y gcc-multilib g++-multilib gcc-aarch64-linux-gnu g++-aarch64-linux-gnu |
| 24 | + |
21 | 25 | - name: Set up PHP |
22 | 26 | uses: shivammathur/setup-php@v2 |
23 | 27 | with: |
24 | 28 | php-version: ${{ matrix.php-version }} |
25 | 29 | tools: php-config |
26 | 30 | extensions: mbstring |
27 | 31 |
|
28 | | - - name: Install cross-compilation tools for aarch64 |
29 | | - if: matrix.arch == 'aarch64-unknown-linux-gnu' |
30 | | - run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu |
31 | | - |
32 | | - - name: Install cross-compilation tools for x86_64 |
33 | | - if: matrix.arch == 'x86_64-unknown-linux-gnu' |
34 | | - run: sudo apt-get update && sudo apt-get install -y gcc-multilib |
35 | | - |
36 | 32 | - name: Set up Rust |
37 | 33 | uses: actions-rs/toolchain@v1 |
38 | 34 | with: |
39 | 35 | toolchain: stable |
40 | | - target: ${{ matrix.arch }} |
| 36 | + target: ${{ matrix.arch }}-unknown-linux-gnu |
41 | 37 |
|
42 | 38 | - name: Install Rust target |
43 | | - run: rustup target add ${{ matrix.arch }} |
| 39 | + run: rustup target add ${{ matrix.arch }}-unknown-linux-gnu |
44 | 40 |
|
45 | 41 | - name: Build project |
46 | | - env: |
47 | | - CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc |
48 | | - CXXFLAGS: "-march=armv8-a" |
49 | | - run: cargo build --release --target ${{ matrix.arch }} |
| 42 | + run: cargo build --release --target ${{ matrix.arch }}-unknown-linux-gnu |
50 | 43 |
|
51 | 44 | - name: Upload build artifacts |
52 | 45 | uses: actions/upload-artifact@v2 |
53 | 46 | with: |
54 | 47 | name: libphprocksdb-${{ matrix.php-version }}-${{ matrix.arch }} |
55 | | - path: target/${{ matrix.arch }}/release/libphprocksdb.so |
| 48 | + path: target/${{ matrix.arch }}-unknown-linux-gnu/release/libphprocksdb.so |
56 | 49 |
|
57 | 50 | release: |
58 | 51 | runs-on: ubuntu-latest |
|
0 commit comments