Fix tagged release workflow YAML structure #53
This file contains hidden or 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: Run CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, macos-14, windows-latest ] | |
| node: [ "20" ] | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{matrix.node}} | |
| cache: npm | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup Windows compiler tools | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install dependencies (skip scripts) | |
| run: npm ci --ignore-scripts | |
| - name: Build native dependencies | |
| env: | |
| BUILD_FOR_ARCH: ${{ runner.arch == 'X64' && 'x64' || 'arm64' }} | |
| run: | | |
| npm run clean-tesseract | |
| npm run build-tesseract | |
| - name: Build native addon | |
| run: npm run build-cc | |
| - name: Add Windows native runtime paths | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| "$env:GITHUB_WORKSPACE\\tesseract\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| "$env:GITHUB_WORKSPACE\\leptonica\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| "$env:GITHUB_WORKSPACE\\libtiff\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| "$env:GITHUB_WORKSPACE\\libpng\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| "$env:GITHUB_WORKSPACE\\libjpeg\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| "$env:GITHUB_WORKSPACE\\zlib\\build\\bin\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Set short Windows temp path | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Path C:\t -Force | Out-Null | |
| "TMP=C:\t" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "TEMP=C:\t" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Run tests | |
| run: | | |
| npm test |