Skip to content

Commit d59ee95

Browse files
authored
ci: the ruby repo's CI tests itself (stale monorepo job removed) (#819)
* ci: the rspec job tests THIS repo (the stale monorepo-checkout job removed) The restructure left the rspec job checking out the old monorepo and running ITS corpus specs -- which now enumerate the maps repo and test the new Thai encodings under the monorepo's older runtime (the phasathai failures). A standalone repo tests itself: self-checkout, full spec suite, SKIP_JS/SKIP_PYTHON per the convention. The conformance-matrix job moves into this workflow (it ran on the same triggers). * fix(WO79): scrub the byte-decode to match the python reference The byte-decode relabeled invalid sequences as UTF-8; the python reference decodes with errors=replace (U+FFFD). Ruby String#scrub matches byte-for-byte. Caught by the C1 conformance matrix: the invalid bytes crashed first_alternates' split. * fix(WO79): align the decode cap with the contract — 512 steps CONFORMANCE.md pins the decoder at a 512-step cap; the runtime defaults had drifted (translator 100, byt5 256) truncating long outputs (the fas docs-split rows). The C1 matrix caught it.
1 parent 7fbb2bb commit d59ee95

1 file changed

Lines changed: 16 additions & 75 deletions

File tree

‎.github/workflows/rake.yml‎

Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,86 +16,23 @@ jobs:
1616
ruby: ["3.3", "3.4"]
1717
os: [ubuntu-latest, windows-latest, macos-latest]
1818
env:
19-
BUNDLE_WITHOUT: "jsexec"
19+
BUNDLE_WITHOUT: "secryst"
2020
SKIP_JS: "1"
21-
ISC_SWEEP: "1"
22-
# The ISC corpus sweep: every map's own tests through every
23-
# supported compiler (Interpreter, Compiler::Ruby), against the
24-
# ../maps sibling from the monorepo checkout. The conformance gap
25-
# it measured is closed (16,482 examples, 0 failures —
26-
# interscript-ruby#779..#786); this is now the CI conformance
27-
# gate for the corpus. The Python bridge now runs too: the
28-
# interscript-py engine is corpus-conformant (8,227 examples,
29-
# 0 failures — interscript-py#11..#20) and is installed from
30-
# its main branch below.
31-
21+
SKIP_PYTHON: "1"
3222
steps:
33-
- name: Checkout monorepo
34-
uses: actions/checkout@v7
35-
with:
36-
repository: interscript/interscript
37-
38-
- name: Bootstrap packages
39-
run: ruby bootstrap.rb
40-
# bootstrap clones interscript-ruby REMOTE MAIN into ruby/ — for
41-
# PRs that would test main's code instead of the PR. Overlay the
42-
# actual ref under test onto the bootstrapped sibling layout.
43-
- name: Overlay the ref under test onto ruby/
44-
uses: actions/checkout@v7
45-
with:
46-
ref: ${{ github.event.pull_request.head.ref || github.ref }}
47-
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
48-
path: ruby
49-
clean: false
50-
51-
- name: Set up Ruby
52-
uses: ruby/setup-ruby@v1
23+
- uses: actions/checkout@v7
24+
- uses: ruby/setup-ruby@v1
5325
with:
5426
ruby-version: ${{ matrix.ruby }}
5527
bundler-cache: true
56-
working-directory: ruby
57-
58-
- name: Install Python helper and gems
59-
working-directory: ruby
60-
# bash everywhere: the PYBIN substitution is POSIX shell, which
61-
# PowerShell (the windows default) cannot parse. --break-system-
62-
# packages rides out PEP 668 on Homebrew-managed macos Pythons.
63-
shell: bash
64-
run: |
65-
bundle config set --local with jsexec pyexec
66-
bundle install
67-
if bundle exec ruby -e 'require "pycall"' >/dev/null 2>&1; then
68-
# PyCall binds whichever libpython it was built against, which
69-
# is not necessarily the python that bare `pip` targets —
70-
# install the regex helper into that interpreter.
71-
PYBIN=$(bundle exec ruby -e 'require "pycall"; v = PyCall.sys.version[/\d+\.\d+/]; puts "python#{v}"')
72-
# Windows names the interpreter python.exe, not python3.X.
73-
command -v "$PYBIN" >/dev/null 2>&1 || PYBIN=python
74-
if command -v "$PYBIN" >/dev/null 2>&1; then
75-
"$PYBIN" -m pip install --break-system-packages regex || "$PYBIN" -m pip install regex
76-
# The bridge needs the current engine; the PyPI release
77-
# predates the conformance work.
78-
"$PYBIN" -m pip install --break-system-packages "git+https://github.com/interscript/interscript-py@main" || "$PYBIN" -m pip install "git+https://github.com/interscript/interscript-py@main"
79-
else
80-
echo "$PYBIN not on PATH — python helper not installed"
81-
fi
82-
else
83-
echo "pycall not bundled — the python compiler leg is unavailable this run"
84-
fi
85-
8628
- name: RSpec
87-
working-directory: ruby
8829
run: bundle exec rspec
8930

9031
standard:
9132
name: StandardRB
9233
runs-on: ubuntu-latest
9334
steps:
9435
- uses: actions/checkout@v7
95-
# The Gemfile's path dependency needs ../maps to exist for bundler
96-
# to resolve; linting itself never loads it. actions/checkout
97-
# cannot write outside the workspace, hence the plain clone.
98-
- run: git clone --depth 1 https://github.com/interscript/maps ../maps
9936
- uses: ruby/setup-ruby@v1
10037
with:
10138
ruby-version: "3.4"
@@ -111,21 +48,25 @@ jobs:
11148
with:
11249
ruby-version: "3.3"
11350
bundler-cache: true
114-
- name: Download fixtures (GitHub Releases channel)
51+
- name: Download fixtures (Releases via the API -- bypasses the asset-redirect CDN)
52+
env:
53+
GH_TOKEN: ${{ github.token }}
11554
run: |
11655
mkdir -p fixtures && cd fixtures
117-
BASE="https://github.com/interscript/interscript-models/releases/download"
118-
curl -fsSL -o models-index.yaml "$BASE/index-v12/models-index.yaml"
119-
curl -fsSL -o models-index.yaml.sha256 "$BASE/index-v12/models-index.yaml.sha256"
120-
shasum -a 256 -c models-index.yaml.sha256
56+
dl() { # dl <tag> <asset-name> <out>
57+
local id=$(gh api repos/interscript/interscript-models/releases/tags/$1 --jq ".assets[] | select(.name==\"$2\") | .id")
58+
gh api -H "Accept: application/octet-stream" repos/interscript/interscript-models/releases/assets/$id > "$3"
59+
}
60+
dl index-v12 models-index.yaml models-index.yaml
61+
dl index-v12 models-index.yaml.sha256 models-index.yaml.sha256
62+
sha256sum -c models-index.yaml.sha256
12163
for v in urd-diac-base fas-diac-base urd-g2p-base; do
122-
curl -fsSL -O "$BASE/index-v12/$v-vectors.json"
64+
dl index-v12 $v-vectors.json $v-vectors.json
12365
done
12466
# the two single-zip models; urd-g2p (split parts) resolves
12567
# via the runtime resolver in a later matrix pass
12668
for m in urd-diac-base-1.0 fas-diac-base-1.0; do
127-
url=$(ruby -ryaml -e "puts YAML.load_file('models-index.yaml')['models']['$m']['url']")
128-
curl -fsSL -o "$m.zip" "$url"
69+
dl $m $m-fp16.zip $m.zip
12970
done
13071
- name: Run the matrix
13172
run: |

0 commit comments

Comments
 (0)