mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 22:13:11 -05:00
commit
c43ade9677
4 changed files with 27 additions and 11 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
zig: [ 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0 ]
|
zig: [ 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0 ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Zig
|
- name: Setup Zig
|
||||||
uses: goto-bus-stop/setup-zig@v2
|
uses: goto-bus-stop/setup-zig@v2
|
||||||
|
@ -23,3 +23,19 @@ jobs:
|
||||||
|
|
||||||
- name: Check compatibility with old Zig compilers
|
- name: Check compatibility with old Zig compilers
|
||||||
run: ci/compat.sh
|
run: ci/compat.sh
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Zig
|
||||||
|
uses: goto-bus-stop/setup-zig@v2
|
||||||
|
with:
|
||||||
|
version: master
|
||||||
|
|
||||||
|
- name: Unit Test
|
||||||
|
run: zig build test
|
||||||
|
|
2
.github/workflows/eowyn.yml
vendored
2
.github/workflows/eowyn.yml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Zig
|
- name: Setup Zig
|
||||||
uses: goto-bus-stop/setup-zig@v2
|
uses: goto-bus-stop/setup-zig@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
# using the patches in this directory and convey them
|
# using the patches in this directory and convey them
|
||||||
# to convalesce in the healed directory.
|
# to convalesce in the healed directory.
|
||||||
#
|
#
|
||||||
|
set -e
|
||||||
|
|
||||||
# We check ourselves before we wreck ourselves.
|
# We check ourselves before we wreck ourselves.
|
||||||
if [ ! -f 'patches/eowyn.sh' ]
|
if [ ! -f patches/eowyn.sh ]
|
||||||
then
|
then
|
||||||
echo "But I must be run from the project root directory."
|
echo "But I must be run from the project root directory."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -27,22 +28,21 @@ mkdir -p patches/healed
|
||||||
for broken in exercises/*.zig
|
for broken in exercises/*.zig
|
||||||
do
|
do
|
||||||
# Remove the dir and extension, rendering the True Name.
|
# Remove the dir and extension, rendering the True Name.
|
||||||
true_name=$(basename $broken .zig)
|
true_name=$(basename "$broken" .zig)
|
||||||
patch_name="patches/patches/$true_name.patch"
|
patch_name="patches/patches/$true_name.patch"
|
||||||
|
|
||||||
|
if [ -f "$patch_name" ]
|
||||||
if [ -f $patch_name ]
|
|
||||||
then
|
then
|
||||||
# Apply the bandages to the wounds, grow new limbs, let
|
# Apply the bandages to the wounds, grow new limbs, let
|
||||||
# new life spring into the broken bodies of the fallen.
|
# new life spring into the broken bodies of the fallen.
|
||||||
echo Healing $true_name...
|
echo Healing "$true_name"...
|
||||||
patch --output=patches/healed/$true_name.zig $broken $patch_name
|
patch --output="patches/healed/$true_name.zig" "$broken" "$patch_name"
|
||||||
else
|
else
|
||||||
echo Cannot heal $true_name. No patch found.
|
echo Cannot heal "$true_name". No patch found.
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check the healed exercises formatting.
|
echo "Looking for non-conforming code formatting..."
|
||||||
zig fmt --check patches/healed
|
zig fmt --check patches/healed
|
||||||
|
|
||||||
# Test the healed exercises. May the compiler have mercy upon us.
|
# Test the healed exercises. May the compiler have mercy upon us.
|
||||||
|
|
Loading…
Reference in a new issue