fixing sporadic TypeScript string set bug #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verification Tests | |
on: | |
push | |
env: | |
PYTHON_VERSION: '3.11' | |
jobs: | |
csharp-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
dotnet-version: ['6', '7', '8', '9'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install .NET v${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v4 | |
id: install-step | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Configure .NET | |
run: | | |
echo '{"sdk":{"version": "${{ steps.install-step.outputs.dotnet-version }}"}}' > ./global.json | |
- name: Run Tests (.NET v${{ matrix.dotnet-version }}) | |
run: | | |
DOTNET_VERSION=${{ matrix.dotnet-version }} pytest --only csharp | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: csharp-dotnet${{ matrix.dotnet-version }}-generated-messages | |
path: out/data | |
typescript-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
node-version: ['18', '20', '22'] | |
typescript-version: ['4', '5'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Node v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Configure TypeScript Version | |
run: | | |
jq ".devDependencies.typescript = \"${{ matrix.typescript-version }}\"" test/_harnesses/typescript/package.json > tmp.json | |
mv tmp.json test/_harnesses/typescript/package.json | |
cat test/_harnesses/typescript/package.json | |
- name: Run Tests (Node v${{ matrix.node-version }} / TypeScript v${{ matrix.typescript-version }}) | |
run: | | |
pytest --only typescript | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: typescript-node${{ matrix.node-version }}-ts${{ matrix.typescript-version }}-generated-messages | |
path: out/data | |
assemblyscript-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
node-version: ['18', '20', '22'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Node v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Run Tests (Node v${{ matrix.node-version }}) | |
run: | | |
pytest --only assemblyscript | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: assemblyscript-node${{ matrix.node-version }}-generated-messages | |
path: out/data | |
go-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
go-version: ['1.19', '1.20', '1.21', '1.22', '1.23'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Go v${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: false | |
- name: Run Tests (Go v${{ matrix.go-version }}) | |
run: | | |
pytest --only go | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: go-${{ matrix.go-version }}-generated-messages | |
path: out/data | |
swift-builds: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
swift-version: ['5.5', '5.6', '5.7', '5.8', '5.9', '5.10', '6.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Swift v${{ matrix.swift-version }} | |
uses: swift-actions/setup-swift@v2 | |
with: | |
swift-version: ${{ matrix.swift-version }} | |
- name: Run Tests (Swift v${{ matrix.swift-version }}) | |
run: | | |
pytest --only swift | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swift-${{ matrix.swift-version }}-generated-messages | |
path: out/data | |
rust-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
rust-version: ['1.65.0', 'stable'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Rust v${{ matrix.rust-version }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
- name: Run Tests (Rust v${{ matrix.rust-version }}) | |
run: | | |
pytest --only rust | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rust-${{ matrix.rust-version }}-generated-messages | |
path: out/data | |
zig-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
zig-version: ['0.13.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Zig v${{ matrix.zig-version }} | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: ${{ matrix.zig-version }} | |
- name: Run Tests (Zig v${{ matrix.zig-version }}) | |
run: | | |
pytest --only zig | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: zig-${{ matrix.zig-version }}-generated-messages | |
path: out/data | |
c-gcc-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
gcc-version: ['9', '10', '11', '12', '13', '14'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install GCC v${{ matrix.gcc-version }} | |
run: | | |
sudo add-apt-repository -y universe | |
sudo apt-get update | |
sudo apt-get install valgrind gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} | |
- name: Run Tests (C [GCC v${{ matrix.gcc-version }}]) | |
run: | | |
CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} pytest --only c | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: c-gcc-${{ matrix.gcc-version}}-generated-messages | |
path: out/data | |
c-clang-builds: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
clang-version: ['14', '15', '16', '17'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Install Clang v${{ matrix.clang-version }} | |
run: | | |
sudo add-apt-repository -y universe | |
sudo apt-get update | |
sudo apt-get install valgrind clang-${{ matrix.clang-version }} | |
- name: Run Tests (C [Clang v${{ matrix.clang-version }}]) | |
run: | | |
CC=clang-${{ matrix.clang-version }} CXX=clang++-${{ matrix.clang-version }} pytest --only c | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: c-clang-${{ matrix.clang-version }}-generated-messages | |
path: out/data | |
c-msvc-builds: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
msvc-version: ['latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Run Tests | |
run: pytest --only c | |
- name: Upload Generated Messages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: c-msvc-generated-messages | |
path: out/data | |
compare-messages: | |
runs-on: ubuntu-latest | |
needs: [ | |
csharp-builds, | |
typescript-builds, | |
assemblyscript-builds, | |
go-builds, | |
swift-builds, | |
rust-builds, | |
zig-builds, | |
c-gcc-builds, | |
c-clang-builds, | |
c-msvc-builds | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Beschi and Python Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev]' | |
- name: Download All Generated Messages | |
uses: actions/download-artifact@v4 | |
with: | |
path: out/data | |
- name: Verify Messages Download (manual check if needed) | |
run: | | |
ls -R out/ | |
- name: Run Comparison Test | |
run: | | |
pytest test/00_compare_all_messages.py | |
build-dist: | |
runs-on: ubuntu-latest | |
needs: ['compare-messages'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[publish]' | |
- name: Build Distribution Package | |
run: | | |
rm -rf dist | |
python -m build | |
- name: Calculate Short SHA | |
id: vars | |
run: | | |
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Upload Distribution Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: beschi-${{ github.ref_name }} | |
path: dist/ | |
publish-pypi: | |
runs-on: ubuntu-latest | |
needs: [build-dist] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
environment: | |
name: pypi | |
url: https://pypi.org/p/beschi | |
permissions: | |
id-token: write | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: beschi-${{ github.ref_name }} | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
publish-brew: | |
runs-on: macos-latest | |
needs: [build-dist] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
environment: | |
name: homebrew | |
url: https://github.com/sjml/homebrew-sjml/blob/main/Formula/beschi.rb | |
steps: | |
- name: Set Version Variable | |
run: echo "BESCHI_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Setup Git Credentials | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | |
run: | | |
SSH_PATH="$HOME/.ssh" | |
mkdir -p "$SSH_PATH" | |
echo "$SSH_DEPLOY_KEY" > "$SSH_PATH/deploy_key" | |
chmod 600 "$SSH_PATH/deploy_key" | |
ssh-keyscan -H "github.com" > "$SSH_PATH/known_hosts" | |
echo "GIT_SSH_COMMAND="ssh -vvv -i $SSH_PATH/deploy_key -o UserKnownHostsFile=$SSH_PATH/known_hosts"" >> $GITHUB_ENV | |
- name: Clone Personal Homebrew Repo | |
env: | |
PUSHER_NAME: ${{ github.event.pusher.name }} | |
PUSHER_EMAIL: ${{ github.event.pusher.email }} | |
run: | | |
git config --global user.name "$PUSHER_NAME" | |
git config --global user.email "$PUSHER_EMAIL" | |
git clone [email protected]:sjml/homebrew-sjml.git homebrew-sjml | |
- name: Update Local Tap | |
# doing manually since `brew bump-formula-pr` has a long installation and wants a PAT? | |
# probably useful if you want to open a PR to the core Homebrew repo, but we're just | |
# gonna push directly to the private tap. | |
run: | | |
wget "https://github.com/sjml/beschi/archive/refs/tags/$BESCHI_VERSION.tar.gz" | |
SHA256_SUM=($(shasum -a 256 $BESCHI_VERSION.tar.gz)) | |
cd homebrew-sjml | |
sed -i .bak -E "s/(\s*)url (.*)$/\1url \"https:\/\/github.com\/sjml\/beschi\/archive\/refs\/tags\/$BESCHI_VERSION.tar.gz\"/" Formula/beschi.rb | |
sed -i .bak -E "s/(\s*)sha256 (.*)$/\1sha256 \"$SHA256_SUM\"/" Formula/beschi.rb | |
rm Formula/*.bak | |
- name: Commit and Push to Remote | |
run: | | |
cd homebrew-sjml | |
git add . | |
git commit -m "Updating beschi to $BESCHI_VERSION" | |
echo "Pushing to remote..." | |
git push |