| 1 | name: CI macOS |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | paths-ignore: |
| 6 | - '**.md' |
| 7 | - '**.yml' |
| 8 | - '!**/macos_ci.yml' |
| 9 | - 'cmd/tools/**' |
| 10 | - '!cmd/tools/builders/**.v' |
| 11 | pull_request: |
| 12 | paths-ignore: |
| 13 | - '**.md' |
| 14 | - '**.yml' |
| 15 | - '!**/macos_ci.yml' |
| 16 | - 'cmd/tools/**' |
| 17 | - '!cmd/tools/builders/**.v' |
| 18 | |
| 19 | concurrency: |
| 20 | group: macos-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} |
| 21 | cancel-in-progress: true |
| 22 | |
| 23 | jobs: |
| 24 | clang-macos: |
| 25 | strategy: |
| 26 | matrix: |
| 27 | os: [macos-14] |
| 28 | fail-fast: false |
| 29 | runs-on: ${{ matrix.os }} |
| 30 | timeout-minutes: 151 |
| 31 | env: |
| 32 | VFLAGS: -cc clang |
| 33 | VTEST_SHOW_LONGEST_BY_RUNTIME: 3 |
| 34 | VTEST_SHOW_LONGEST_BY_COMPTIME: 3 |
| 35 | VTEST_SHOW_LONGEST_BY_TOTALTIME: 3 |
| 36 | steps: |
| 37 | - uses: actions/checkout@v6 |
| 38 | - name: Cache Homebrew downloads |
| 39 | uses: actions/cache@v4 |
| 40 | with: |
| 41 | path: ~/Library/Caches/Homebrew |
| 42 | key: brew-${{ matrix.os }}-${{ hashFiles('.github/workflows/macos_ci.yml', 'ci/macos_ci.vsh') }} |
| 43 | restore-keys: | |
| 44 | brew-${{ matrix.os }}- |
| 45 | - name: Build V |
| 46 | run: make -j4 && ./v symlink |
| 47 | - name: Test symlink |
| 48 | run: v run ci/macos_ci.vsh test_symlink |
| 49 | - name: v doctor |
| 50 | run: v run ci/macos_ci.vsh v_doctor |
| 51 | - name: Build v with -prealloc |
| 52 | run: v run ci/macos_ci.vsh build_v_with_prealloc |
| 53 | - name: Test cross compilation to Linux |
| 54 | run: v run ci/macos_ci.vsh test_cross_compilation |
| 55 | - name: Test inline assembly on macos |
| 56 | run: v run ci/macos_ci.vsh test_inline_assembly |
| 57 | - name: Build V with -cstrict |
| 58 | run: v run ci/macos_ci.vsh build_with_cstrict |
| 59 | - name: All code is formatted |
| 60 | run: v run ci/macos_ci.vsh all_code_is_formatted |
| 61 | - name: Run sanitizers |
| 62 | run: v run ci/macos_ci.vsh run_sanitizers |
| 63 | - name: Build V using V |
| 64 | run: v run ci/macos_ci.vsh build_using_v |
| 65 | - name: Verify `v test` works |
| 66 | run: v run ci/macos_ci.vsh verify_v_test_works |
| 67 | - name: Install iconv for encoding.iconv |
| 68 | run: v run ci/macos_ci.vsh install_iconv |
| 69 | - name: Test pure V math module |
| 70 | run: v run ci/macos_ci.vsh test_pure_v_math_module |
| 71 | - name: Self tests |
| 72 | run: v run ci/macos_ci.vsh self_tests |
| 73 | - name: Build examples |
| 74 | run: v run ci/macos_ci.vsh build_examples |
| 75 | - name: Build tetris with -autofree |
| 76 | run: v run ci/macos_ci.vsh build_tetris_autofree |
| 77 | - name: Build blog tutorial with -autofree |
| 78 | run: v run ci/macos_ci.vsh build_blog_autofree |
| 79 | - name: Build examples with -prod |
| 80 | run: v run ci/macos_ci.vsh build_examples_prod |
| 81 | - name: Build examples with V build with tcc |
| 82 | run: v run ci/macos_ci.vsh build_examples_v_compiled_with_tcc |
| 83 | ## - name: V self compilation with -usecache |
| 84 | ## run: v run ci/macos_ci.vsh v_self_compilation_usecache |
| 85 | - name: V self compilation with -parallel-cc |
| 86 | run: v run ci/macos_ci.vsh v_self_compilation_parallel_cc |
| 87 | ##- name: v2 test suite |
| 88 | ## run: bash cmd/v2/test_all.sh |
| 89 | - name: Test password input |
| 90 | run: v run ci/macos_ci.vsh test_password_input |
| 91 | - name: Test readline |
| 92 | run: v run ci/macos_ci.vsh test_readline |
| 93 | |