mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 14:03:10 -05:00
Merge pull request #269 from perillo/fix-windows-deadlock
Fix deadlock on Windows
This commit is contained in:
commit
6b48914d7a
4 changed files with 12 additions and 50 deletions
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
|
@ -1,5 +1,4 @@
|
||||||
name: 'CI'
|
name: CI
|
||||||
# Makes some checks
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -28,11 +27,11 @@ jobs:
|
||||||
- name: Check compatibility with old Zig compilers
|
- name: Check compatibility with old Zig compilers
|
||||||
run: ci/compat.sh
|
run: ci/compat.sh
|
||||||
|
|
||||||
test-linux_mac:
|
test:
|
||||||
name: Unit Tests
|
name: Unit Tests
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
|
@ -46,19 +45,3 @@ jobs:
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: zig build test
|
run: zig build test
|
||||||
|
|
||||||
test-windows:
|
|
||||||
name: Unit Test Windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Zig
|
|
||||||
uses: goto-bus-stop/setup-zig@v2
|
|
||||||
with:
|
|
||||||
version: master
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
run: zig build test
|
|
||||||
|
|
23
.github/workflows/eowyn.yml
vendored
23
.github/workflows/eowyn.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
name: 'Eowyn'
|
# Test that exercises work with the latest Zig compiler.
|
||||||
# Tests all exercises
|
name: Eowyn
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -13,10 +13,10 @@ defaults:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux_mac:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
|
@ -30,18 +30,3 @@ jobs:
|
||||||
|
|
||||||
- name: Run Eowyn
|
- name: Run Eowyn
|
||||||
run: patches/eowyn.sh
|
run: patches/eowyn.sh
|
||||||
|
|
||||||
build-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Zig
|
|
||||||
uses: goto-bus-stop/setup-zig@v2
|
|
||||||
with:
|
|
||||||
version: master
|
|
||||||
|
|
||||||
- name: Run Eowyn
|
|
||||||
run: patches/eowyn.sh
|
|
||||||
|
|
|
@ -45,13 +45,8 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Test the correct formatting of the healed exercises.
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
echo "Looking for non-conforming code formatting..."
|
||||||
for healed in patches/healed/*.zig
|
zig fmt --check patches/healed
|
||||||
do
|
|
||||||
echo Check $(basename "$healed")
|
|
||||||
zig fmt --check "$healed"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Test the healed exercises. May the compiler have mercy upon us.
|
# Test the healed exercises. May the compiler have mercy upon us.
|
||||||
zig build -Dhealed
|
zig build -Dhealed
|
||||||
|
|
|
@ -333,10 +333,9 @@ fn heal(allocator: Allocator, exercises: []const Exercise, outdir: []const u8) !
|
||||||
};
|
};
|
||||||
const output = try join(allocator, &.{ outdir, ex.main_file });
|
const output = try join(allocator, &.{ outdir, ex.main_file });
|
||||||
|
|
||||||
const argv = &.{ "patch", "-i", patch, "-o", output, file };
|
const argv = &.{ "patch", "-i", patch, "-o", output, "-s", file };
|
||||||
|
|
||||||
var child = std.process.Child.init(argv, allocator);
|
var child = std.process.Child.init(argv, allocator);
|
||||||
child.stdout_behavior = .Ignore; // the POSIX standard says that stdout is not used
|
|
||||||
_ = try child.spawnAndWait();
|
_ = try child.spawnAndWait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue