| 1 | name: VPM CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | paths: |
| 8 | - '**/vpm_ci.yml' |
| 9 | - '**/cmd/tools/vpm/**' |
| 10 | pull_request: |
| 11 | paths: |
| 12 | - '**/vpm_ci.yml' |
| 13 | - '**/cmd/tools/vpm/**' |
| 14 | |
| 15 | concurrency: |
| 16 | group: vpm-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} |
| 17 | cancel-in-progress: true |
| 18 | |
| 19 | jobs: |
| 20 | setup-vpm: |
| 21 | strategy: |
| 22 | matrix: |
| 23 | os: [ubuntu-latest, windows-latest, macos-latest] |
| 24 | fail-fast: false |
| 25 | runs-on: ${{ matrix.os }} |
| 26 | steps: |
| 27 | - uses: actions/checkout@v6 |
| 28 | with: |
| 29 | path: vlang |
| 30 | - name: Show git version |
| 31 | run: git version |
| 32 | - name: Build V |
| 33 | if: runner.os != 'Windows' |
| 34 | run: cd vlang && make -j4 && ./v doctor |
| 35 | - name: Build V (Windows) |
| 36 | if: runner.os == 'Windows' |
| 37 | run: cd vlang && ./makev.bat && ./v doctor |
| 38 | - name: Cache V |
| 39 | uses: actions/cache/save@v5 |
| 40 | with: |
| 41 | path: vlang |
| 42 | key: ${{ runner.os }}-${{ github.sha }} |
| 43 | |
| 44 | test-vpm: |
| 45 | needs: setup-vpm |
| 46 | strategy: |
| 47 | matrix: |
| 48 | include: |
| 49 | - os: ubuntu-latest |
| 50 | cc: tcc |
| 51 | - os: ubuntu-latest |
| 52 | cc: gcc |
| 53 | - os: ubuntu-latest |
| 54 | cc: clang |
| 55 | - os: macos-latest |
| 56 | cc: clang |
| 57 | - os: windows-latest |
| 58 | cc: tcc |
| 59 | - os: windows-latest |
| 60 | cc: gcc |
| 61 | - os: windows-latest |
| 62 | cc: msvc |
| 63 | fail-fast: false |
| 64 | runs-on: ${{ matrix.os }} |
| 65 | steps: |
| 66 | - name: Restore V cache |
| 67 | uses: actions/cache/restore@v5 |
| 68 | with: |
| 69 | path: vlang |
| 70 | key: ${{ runner.os }}-${{ github.sha }} |
| 71 | - name: Show git version |
| 72 | run: git version |
| 73 | - name: Build and test VPM |
| 74 | run: | |
| 75 | cd vlang |
| 76 | ./v -W -N cmd/tools/vpm |
| 77 | ./v -cc ${{ matrix.cc }} -d network test cmd/tools/vpm |
| 78 | |