From 52ade38c08acaf1dd27311475f4e30fe0c67431e Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Thu, 13 Nov 2025 15:19:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Test=20against=20source=20NSS=20?= =?UTF-8?q?on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 60 ++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba607b5..e3d50c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,27 +9,69 @@ jobs: os: [ubuntu, macos, windows] # pypy3 not yet up to speed with py3.9 typing hints # python-version: [3.9, 3.10.0-alpha.6, pypy3] - python-version: ['3.9', '3.10', '3.11'] - firefox: ['latest-esr', 'latest'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + nss-source: ['latest-esr', 'latest', 'NSS_3_117_RTM', 'NSS_3_112_2_RTM', 'system'] env: # Needed to force UTF-8 and have consistent behavior in Windows PYTHONUTF8: 1 + # Compile NSS for Linux 64 bits + USE_64: 1 steps: - - uses: actions/checkout@main + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@master + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Setup firefox ${{ matrix.firefox }} + + - name: Setup Firefox ${{ matrix.firefox }} if: | - matrix.os == 'ubuntu' || - (matrix.os == 'windows' && matrix.firefox == '87.0') + 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' }} - run: brew install nss + 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 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 + + - name: Prepare system-level lib resolution + if: | + ( + startsWith(matrix.nss-source, 'NSS') && matrix.os == 'ubuntu' + ) + run: | + echo "${{ github.workspace }}/dist/Debug/lib" > /etc/ld.so.conf.d/nss-libs.conf + ldconfig + - name: Run tests run: | cd tests