Skip to content

Commit

Permalink
ci: fix CI=name ./v -d network test cmd/tools/vpm/ ; update the ima…
Browse files Browse the repository at this point in the history
…ge runners in vpm_ci.yml (#23628)
  • Loading branch information
spytheman authored Feb 2, 2025
1 parent b8c7892 commit e68fab8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/vpm_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ concurrency:
cancel-in-progress: true

jobs:
setup:
setup-vpm:
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-14]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
path: vlang
- name: Show git version
run: git version
- name: Build V
if: runner.os != 'Windows'
run: cd vlang && make -j4 && ./v doctor
Expand All @@ -37,34 +39,34 @@ jobs:
path: vlang
key: ${{ runner.os }}-${{ github.sha }}

test:
needs: setup
test-vpm:
needs: setup-vpm
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-latest
cc: tcc
- os: ubuntu-20.04
- os: ubuntu-latest
cc: gcc
- os: ubuntu-20.04
- os: ubuntu-latest
cc: clang
- os: windows-2019
- os: macos-latest
cc: clang
- os: windows-latest
cc: tcc
- os: windows-2019
- os: windows-latest
cc: gcc
- os: windows-2019
- os: windows-latest
cc: msvc
- os: macos-14
cc: clang
fail-fast: false
runs-on: ${{ matrix.os }}
env:
VFLAGS: -cc ${{ matrix.cc }} -d network
steps:
- name: Restore V cache
uses: actions/cache/restore@v4
with:
path: vlang
key: ${{ runner.os }}-${{ github.sha }}
- name: Show git version
run: git version
- name: Test
run: cd vlang && ./v test cmd/tools/vpm
run: cd vlang && ./v -cc ${{ matrix.cc }} -d network test cmd/tools/vpm
2 changes: 1 addition & 1 deletion cmd/tools/vpm/install_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn test_get_installed_version() {

// Create a tag -> latests commit and tag are at the same state,
// but it should not be treated as a version installation, when there is another head branch.
res = cmd_ok(@LOCATION, 'git tag v0.1.0')
res = cmd_ok(@LOCATION, 'git tag v0.1.0 -m "some tag message"') // note: without a tag message, git will try to start an editor when you run this test locally, which will block
mod.is_installed = false
mod.get_installed()
assert mod.is_installed
Expand Down
11 changes: 6 additions & 5 deletions cmd/tools/vpm/outdated_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ fn test_outdated() {
assert is_outdated(m)
}
res := cmd_ok(@LOCATION, '${vexe} outdated')
assert res.output.contains('Outdated modules:'), res.output
assert res.output.contains('pcre'), res.output
assert res.output.contains('vtray'), res.output
assert res.output.contains('nedpals.args'), res.output
assert !res.output.contains('libsodium'), res.output
output := res.output.all_after('Outdated modules:')
assert output.len > 0, output
assert output.contains('pcre'), output
assert output.contains('vtray'), output
assert output.contains('nedpals.args'), output
assert !output.contains('libsodium'), output
}
1 change: 1 addition & 0 deletions cmd/tools/vpm/settings.v
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fn init_settings() VpmSettings {
is_ci := os.getenv('CI') != ''

mut logger := &log.Log{}
logger.set_output_stream(os.stderr())
if is_dbg {
logger.set_level(.debug)
}
Expand Down

0 comments on commit e68fab8

Please sign in to comment.