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