Validate 'isFirstParty' logic for tracker that only has eTLD+2 domain defined #217
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: Test Implementations | |
# If this job is failing, check if there were any updates to | |
# https://github.com/duckduckgo/BrowserServicesKit/blob/main/.github/workflows/pr.yml | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
extension-mv2: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: 'reference-tests' | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'duckduckgo/duckduckgo-privacy-extension' | |
path: 'extension' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: 'extension/package-lock.json' | |
- run: cd reference-tests && npm link | |
- name: Setup Extension | |
working-directory: ./extension | |
run: | | |
npm run install-ci | |
npm link @duckduckgo/privacy-reference-tests | |
- name: Test Extension (MV2) | |
working-directory: ./extension | |
run: | | |
npm test | |
ddg2dnr: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: 'reference-tests' | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'duckduckgo/duckduckgo-privacy-extension' | |
path: 'extension' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: 'extension/package-lock.json' | |
- run: cd reference-tests && npm link | |
- name: Setup Extension | |
working-directory: ./extension | |
run: | | |
npm run install-ci | |
npm link @duckduckgo/privacy-reference-tests | |
- name: Test ddg2dnr (MV3) | |
working-directory: ./extension/packages/ddg2dnr | |
run: npm test -- --grep Reference | |
BrowserServicesKit: | |
name: BSK unit tests | |
runs-on: macos-14 | |
timeout-minutes: 30 | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
repository: 'duckduckgo/BrowserServicesKit' | |
path: 'BrowserServicesKit' | |
submodules: recursive | |
- name: Check out the tests | |
uses: actions/checkout@v4 | |
with: | |
path: 'BrowserServicesKit/Tests/BrowserServicesKitTests/Resources/privacy-reference-tests' | |
- name: Set cache key hash | |
working-directory: ./BrowserServicesKit | |
run: | | |
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' Package.resolved) | |
if [[ "$has_only_tags" == "true" ]]; then | |
echo "cache_key_hash=${{ hashFiles('Package.resolved') }}" >> $GITHUB_ENV | |
else | |
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache." | |
fi | |
- name: Cache SPM | |
if: env.cache_key_hash | |
uses: actions/cache@v4 | |
with: | |
path: ./BrowserServicesKit/build | |
key: ${{ runner.os }}-spm-${{ env.cache_key_hash }} | |
restore-keys: | | |
${{ runner.os }}-spm- | |
- name: Select Xcode | |
run: sudo xcode-select -s /Applications/Xcode_$(<BrowserServicesKit/.xcode-version).app/Contents/Developer | |
- name: Build BSK | |
working-directory: ./BrowserServicesKit | |
run: set -o pipefail && swift build | tee build-log.txt | xcbeautify | |
- name: Run tests | |
working-directory: ./BrowserServicesKit | |
run: set -o pipefail && swift test | tee -a build-log.txt | xcbeautify --report junit --report-path . --junit-report-filename tests.xml | |
- name: Publish Unit Tests Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() | |
with: | |
check_name: BSK Test Report | |
report_paths: ./BrowserServicesKit/tests.xml | |
require_tests: true | |
- name: Upload logs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: build-log.txt | |
path: ./BrowserServicesKit/build-log.txt |