|
| 1 | +name: AArch64 GitHub CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: {} |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} |
| 10 | + |
| 11 | +env: |
| 12 | + SPEC_SPLIT_DOTS: 160 |
| 13 | + |
| 14 | +jobs: |
| 15 | + aarch64-github-cross-compile: |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + steps: |
| 18 | + - name: Download Crystal source |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Install LLVM 20 |
| 22 | + run: | |
| 23 | + sudo apt remove 'llvm-*' 'libllvm*' |
| 24 | + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc |
| 25 | + sudo apt-add-repository -y deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main |
| 26 | + sudo apt install -y llvm-20-dev |
| 27 | +
|
| 28 | + - name: Install Crystal |
| 29 | + uses: crystal-lang/install-crystal@v1 |
| 30 | + with: |
| 31 | + crystal: "1.15.1" |
| 32 | + |
| 33 | + - name: Cross-compile Crystal |
| 34 | + run: make target=aarch64-linux-gnu release=1 |
| 35 | + |
| 36 | + - name: Upload crystal.o |
| 37 | + uses: actions/upload-artifact@v4 |
| 38 | + with: |
| 39 | + name: aarch64-linux-crystal-o |
| 40 | + path: .build/crystal.o |
| 41 | + |
| 42 | + aarch64-github-build: |
| 43 | + runs-on: ubuntu-24.04-arm |
| 44 | + needs: [aarch64-github-cross-compile] |
| 45 | + steps: |
| 46 | + - name: Checkout Crystal source |
| 47 | + uses: actions/checkout@v4 |
| 48 | + |
| 49 | + - name: Install LLVM 20 |
| 50 | + run: | |
| 51 | + sudo apt remove 'llvm-*' 'libllvm*' |
| 52 | + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc |
| 53 | + sudo apt-add-repository -y deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main |
| 54 | + sudo apt install -y llvm-20-dev |
| 55 | +
|
| 56 | + - name: Install dependencies |
| 57 | + run: | |
| 58 | + sudo apt install -y lld libgc-dev libpcre2-dev |
| 59 | +
|
| 60 | + - name: Download crystal.o |
| 61 | + uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + name: aarch64-linux-crystal-o |
| 64 | + |
| 65 | + - name: Link Crystal |
| 66 | + run: | |
| 67 | + mkdir .build |
| 68 | + # shellcheck disable=SC2046 |
| 69 | + cc crystal.o -o .build/crystal \ |
| 70 | + $(pkg-config bdw-gc libpcre2-8 --libs) \ |
| 71 | + $(llvm-config-20 --libs --system-libs --ldflags) \ |
| 72 | + -lm |
| 73 | + bin/crystal --version |
| 74 | +
|
| 75 | + - name: Run stdlib specs |
| 76 | + run: make std_spec |
| 77 | + |
| 78 | + - name: Run compiler specs |
| 79 | + run: make compiler_spec |
| 80 | + |
| 81 | + - name: Run interpreter specs |
| 82 | + run: make interpreter_spec |
| 83 | + |
| 84 | + - name: Run primitives specs |
| 85 | + run: make -o .build/crystal.exe primitives_spec # we know the compiler is fresh; do not rebuild it here |
0 commit comments