| 1 | name: Websockets CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | paths-ignore: |
| 8 | - '**.md' |
| 9 | - '**.yml' |
| 10 | - '!**/websockets_ci.yml' |
| 11 | - 'cmd/tools/**' |
| 12 | - '!cmd/tools/builders/**.v' |
| 13 | pull_request: |
| 14 | paths-ignore: |
| 15 | - '**.md' |
| 16 | - '**.yml' |
| 17 | - '!**/websockets_ci.yml' |
| 18 | - 'cmd/tools/**' |
| 19 | - '!cmd/tools/builders/**.v' |
| 20 | |
| 21 | concurrency: |
| 22 | group: websockets-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} |
| 23 | cancel-in-progress: true |
| 24 | |
| 25 | jobs: |
| 26 | websocket_tests: |
| 27 | runs-on: ubuntu-24.04 |
| 28 | timeout-minutes: 121 |
| 29 | env: |
| 30 | VFLAGS: -cc tcc -no-retry-compilation |
| 31 | steps: |
| 32 | - uses: actions/checkout@v6 |
| 33 | - uses: ./.github/actions/cache-apt-packages-action |
| 34 | - name: Build v |
| 35 | run: | |
| 36 | echo "$VFLAGS" |
| 37 | sudo ln -s "$PWD/thirdparty/tcc/tcc.exe" /usr/local/bin/tcc ## TODO: remove |
| 38 | make -j4 && ./v symlink |
| 39 | ./v -g -o v cmd/v |
| 40 | - name: Install dependencies |
| 41 | run: v retry -- sudo apt install --quiet -y libssl-dev |
| 42 | - name: v doctor |
| 43 | run: ./v doctor |
| 44 | - name: Run websockets tests |
| 45 | run: ./v -g test vlib/net/websocket/ |
| 46 | |
| 47 | ## Autobahn integrations tests |
| 48 | - name: Run autobahn services |
| 49 | run: docker compose -f ${{github.workspace}}/vlib/net/websocket/tests/autobahn/docker-compose.yml up -d |
| 50 | |
| 51 | - name: Wait for the service to start |
| 52 | run: sleep 10s |
| 53 | |
| 54 | - name: Build client test |
| 55 | run: docker exec autobahn_client "/src/v" "/src/vlib/net/websocket/tests/autobahn/autobahn_client.v" |
| 56 | - name: Run client test |
| 57 | run: docker exec autobahn_client "/src/vlib/net/websocket/tests/autobahn/autobahn_client" |
| 58 | |
| 59 | - name: Build client wss test |
| 60 | run: docker exec autobahn_client "/src/v" "/src/vlib/net/websocket/tests/autobahn/autobahn_client_wss.v" |
| 61 | |
| 62 | - name: Run client wss test |
| 63 | run: docker exec autobahn_client "/src/vlib/net/websocket/tests/autobahn/autobahn_client_wss" |
| 64 | - name: Run server test |
| 65 | run: docker exec autobahn_server "wstest" "-m" "fuzzingclient" "-s" "/config/fuzzingclient.json" |
| 66 | |
| 67 | - name: Copy reports |
| 68 | run: docker cp autobahn_server:/reports ${{github.workspace}}/reports |
| 69 | - name: Copy reports wss |
| 70 | run: docker cp autobahn_server_wss:/reports ${{github.workspace}}/reports_wss |
| 71 | - name: Test success |
| 72 | run: docker exec autobahn_server "python" "/check_results.py" |
| 73 | - name: Test success WSS |
| 74 | run: docker exec autobahn_server_wss "python" "/check_results.py" |
| 75 | |
| 76 | - name: Publish all reports |
| 77 | uses: actions/upload-artifact@v7 |
| 78 | with: |
| 79 | name: full report |
| 80 | path: ${{github.workspace}}/reports |
| 81 | |
| 82 | - name: Publish report client |
| 83 | uses: actions/upload-artifact@v7 |
| 84 | with: |
| 85 | name: client |
| 86 | path: ${{github.workspace}}/reports/clients/index.html |
| 87 | |
| 88 | - name: Publish report server |
| 89 | uses: actions/upload-artifact@v7 |
| 90 | with: |
| 91 | name: server |
| 92 | path: ${{github.workspace}}/reports/servers/index.html |
| 93 | |
| 94 | - name: Publish all reports WSS |
| 95 | uses: actions/upload-artifact@v7 |
| 96 | with: |
| 97 | name: full report wss |
| 98 | path: ${{github.workspace}}/reports_wss |
| 99 | |
| 100 | - name: Publish report client wss |
| 101 | uses: actions/upload-artifact@v7 |
| 102 | with: |
| 103 | name: client wss |
| 104 | path: ${{github.workspace}}/reports_wss/clients/index.html |
| 105 | |