name: Periodic CI

on:
  schedule:
    - cron: '0 */6 * * *'
  push:
    paths:
      - '**/periodic_ci.yml'
  pull_request:
    paths:
      - '**/periodic_ci.yml'

jobs:
  periodic-network:
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            cc: tcc
          - os: windows-latest
            cc: msvc
          - os: macos-13
            cc: clang
      fail-fast: false
    runs-on: ${{ matrix.os }}
    if: github.event_name != 'schedule' || (github.ref == 'refs/heads/master' && github.repository == 'vlang/v')
    timeout-minutes: 30
    env:
      VFLAGS: -cc ${{ matrix.cc }}
      V_CI_PERIODIC: 1
    steps:
      - uses: actions/checkout@v4
      - name: Build
        if: runner.os != 'Windows'
        run: make -j4 && ./v -showcc -o v cmd/v && ./v doctor
      - name: Build V (Windows)
        if: runner.os == 'Windows'
        run: ./make.bat -msvc && ./v -o v2.exe cmd/v && ./v2 -showcc -o v.exe cmd/v && ./v doctor
      - name: Test
        run: ./v -d network -silent test-self vlib/net
