|
| 1 | +name: freebsd-test-run |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +jobs: |
| 9 | + freebsd-test-run: |
| 10 | + # Run on a branch push and on a pull request from a fork. A pull request |
| 11 | + # from a branch of this repository is tested by the push of that branch. |
| 12 | + if: | |
| 13 | + github.event_name == 'push' || |
| 14 | + github.event_name == 'pull_request' && |
| 15 | + github.event.pull_request.head.repo.full_name != github.repository |
| 16 | +
|
| 17 | + # DO NOT MERGE: several runs of the same job show the noise in timings. |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + run: [1, 2, 3, 4, 5] |
| 22 | + |
| 23 | + # ubuntu-latest will be 26.04 soon. Switch ahead of time. |
| 24 | + # |
| 25 | + # https://github.com/actions/runner-images/issues/14748 |
| 26 | + runs-on: ubuntu-26.04 |
| 27 | + |
| 28 | + timeout-minutes: 15 |
| 29 | + |
| 30 | + steps: |
| 31 | + # Speeds up actions/checkout. |
| 32 | + # |
| 33 | + # https://github.com/actions/checkout/issues/945 |
| 34 | + - name: Parallelize submodules fetching |
| 35 | + run: git config --global submodule.fetchJobs 8 |
| 36 | + |
| 37 | + - uses: actions/checkout@v7 |
| 38 | + with: |
| 39 | + # The version of the build is `git describe` of the tree. |
| 40 | + fetch-depth: 0 |
| 41 | + submodules: recursive |
| 42 | + |
| 43 | + - name: Start FreeBSD VM |
| 44 | + uses: cross-platform-actions/action@v1 |
| 45 | + with: |
| 46 | + operating_system: freebsd |
| 47 | + version: '15.1' |
| 48 | + # The default is 2: the CPU count of a standard Linux runner when |
| 49 | + # the option appeared (2023) and of a private repository's runner |
| 50 | + # now. A public repository's runner has 4. |
| 51 | + cpu_count: 4 |
| 52 | + |
| 53 | + # FreeBSD offers only /dev/fd/{0,1,2} by default. |
| 54 | + # |
| 55 | + # luatest uses /dev/fd/* to point tarantool's logger to luatest's pipe. |
| 56 | + # If the file to write doesn't exist, the logger process fails: |
| 57 | + # |
| 58 | + # | /bin/sh: cannot create /dev/fd/15: Operation not supported |
| 59 | + # |
| 60 | + # Usually it happens in the background and is harmless, but sometimes the |
| 61 | + # logger fails fast enough, so log_pipe_init() sees it, reports up and |
| 62 | + # tarantool initialization fails. |
| 63 | + - name: Mount fdescfs |
| 64 | + shell: cpa.sh {0} |
| 65 | + run: sudo mount -t fdescfs null /dev/fd |
| 66 | + |
| 67 | + # test-run.py needs Python with gevent and PyYAML. |
| 68 | + - name: Install dependencies |
| 69 | + shell: cpa.sh {0} |
| 70 | + run: | |
| 71 | + sudo pkg install -y cmake-core git-lite icu ninja readline \ |
| 72 | + python3 py312-gevent py312-pyyaml |
| 73 | +
|
| 74 | + - name: Build |
| 75 | + shell: cpa.sh {0} |
| 76 | + run: | |
| 77 | + cmake . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DTEST_BUILD=ON |
| 78 | + cmake --build . |
| 79 | +
|
| 80 | + - name: Run tests |
| 81 | + shell: cpa.sh {0} |
| 82 | + run: cd test && ./test-run.py --force unit/ app-luatest/ |
0 commit comments