|
| 1 | +# This CI job checks whether at least the smoke tests pass for the oldest |
| 2 | +# Go/LLVM version we claim to support. |
| 3 | + |
| 4 | +name: Version compatibility test |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - dev |
| 11 | + - release |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + test-compat: |
| 19 | + runs-on: ubuntu-22.04 # this must be a specific version for the apt install below |
| 20 | + env: |
| 21 | + # Oldest versions currently supported by TinyGo |
| 22 | + LLVM: "15" |
| 23 | + Go: "1.23" |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v6 |
| 27 | + with: |
| 28 | + submodules: true |
| 29 | + - name: Install Go |
| 30 | + uses: actions/setup-go@v6 |
| 31 | + with: |
| 32 | + go-version: ${{ env.Go }} |
| 33 | + cache: true |
| 34 | + - name: Install LLVM |
| 35 | + run: | |
| 36 | + echo 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ env.LLVM }} main' | sudo tee /etc/apt/sources.list.d/llvm.list |
| 37 | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - |
| 38 | + sudo apt-get update |
| 39 | + sudo apt-get install --no-install-recommends -y \ |
| 40 | + llvm-${{ env.LLVM }}-dev \ |
| 41 | + clang-${{ env.LLVM }} \ |
| 42 | + libclang-${{ env.LLVM }}-dev \ |
| 43 | + lld-${{ env.LLVM }} \ |
| 44 | + binaryen |
| 45 | + - name: Restore LLVM source cache |
| 46 | + uses: actions/cache/restore@v5 |
| 47 | + id: cache-llvm-source |
| 48 | + with: |
| 49 | + key: llvm-source-20-linux-compat |
| 50 | + path: llvm-project/compiler-rt |
| 51 | + - name: Download LLVM source |
| 52 | + if: steps.cache-llvm-source.outputs.cache-hit != 'true' |
| 53 | + run: make llvm-source |
| 54 | + - name: Save LLVM source cache |
| 55 | + uses: actions/cache/save@v5 |
| 56 | + if: steps.cache-llvm-source.outputs.cache-hit != 'true' |
| 57 | + with: |
| 58 | + key: ${{ steps.cache-llvm-source.outputs.cache-primary-key }} |
| 59 | + path: llvm-project/compiler-rt |
| 60 | + - name: Go cache |
| 61 | + uses: actions/cache@v5 |
| 62 | + with: |
| 63 | + path: | |
| 64 | + ~/.cache/go-build |
| 65 | + ~/go/pkg/mod |
| 66 | + key: go-build-${{ env.Go }}-llvm${{ env.LLVM }}-${{ hashFiles('go.sum') }} |
| 67 | + - name: Build TinyGo |
| 68 | + run: go install -tags=llvm${{ env.LLVM }} |
| 69 | + - run: tinygo version |
| 70 | + - run: make gen-device -j4 |
| 71 | + - run: go test -tags=llvm${{ env.LLVM }} -short -skip=TestErrors |
| 72 | + - run: make smoketest XTENSA=0 |
0 commit comments