👷 Test all we can, don't stop on first error #102
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: Test firefox_decrypt | |
| on: [workflow_dispatch, push] | |
| jobs: | |
| test-firefox: | |
| runs-on: ${{ matrix.os }}-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu, macos, windows] | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| # We need NSS 3.113+ to support Firefox 144 profiles | |
| # See https://github.com/unode/firefox_decrypt/issues/120 | |
| nss-source: ['latest-esr', 'latest', 'NSS_3_117_RTM', 'system'] | |
| exclude: | |
| - os: macos | |
| # Not installing from source on MacOS | |
| nss-source: NSS_3_117_RTM | |
| - os: macos | |
| # Firefox bundles don't work well for us | |
| nss-source: latest | |
| - os: macos | |
| # Firefox bundles don't work well for us | |
| nss-source: latest-esr | |
| - os: windows | |
| # Not installing from source on Windows | |
| nss-source: NSS_3_117_RTM | |
| - os: windows | |
| # No system lib for Windows | |
| nss-source: system | |
| - os: ubuntu | |
| # Official nss packages are way too old | |
| nss-source: system | |
| env: | |
| # Needed to force UTF-8 and have consistent behavior in Windows | |
| PYTHONUTF8: 1 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup Firefox ${{ matrix.firefox }} | |
| if: | | |
| startsWith(matrix.nss-source, 'latest') && ( | |
| matrix.os == 'ubuntu' || matrix.os == 'windows' | |
| ) | |
| uses: browser-actions/setup-firefox@latest | |
| with: | |
| firefox-version: ${{ matrix.firefox }} | |
| - name: Install nss via homebrew | |
| if: | | |
| (matrix.os == 'macos' && matrix.nss-source == 'system') | |
| run: | | |
| brew install nss | |
| brew list --versions nss | |
| - name: Cache NSS built from source | |
| id: cache-nss | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| nss-${{ matrix.nss-source }} | |
| nspr | |
| dist | |
| key: ${{ matrix.nss-source }}-${{ matrix.os }} | |
| - name: Build (Release) NSS from source | |
| if: | | |
| ( | |
| startsWith(matrix.nss-source, 'NSS') && matrix.os == 'ubuntu' && steps.cache-nss.outputs.cache-hit != 'true' | |
| ) | |
| run: | | |
| apt update && apt install -y mercurial git ninja-build python3-pip | |
| python3 -m pip install gyp-next | |
| hg clone https://hg.mozilla.org/projects/nspr | |
| wget https://hg.mozilla.org/projects/nss/archive/${{ matrix.nss-source }}.zip | |
| unzip ${{ matrix.nss-source }}.zip | |
| cd nss-${{ matrix.nss-source }} | |
| ./build.sh -o --enable-legacy-db | |
| - name: Prepare system-level lib resolution | |
| if: | | |
| ( | |
| startsWith(matrix.nss-source, 'NSS') && matrix.os == 'ubuntu' | |
| ) | |
| run: | | |
| echo "${{ github.workspace }}/dist/Release/lib" | sudo tee /etc/ld.so.conf.d/nss-libs.conf | |
| sudo ldconfig | |
| - name: Run tests | |
| run: | | |
| cd tests | |
| python show_encodings | |
| python run_all -v |