mirror of
https://github.com/v2fly/domain-list-community.git
synced 2026-11-27 17:54:36 +02:00
The public suffix list includes onion and arpa in its ICANN section, but neither namespace represents registry registrations. Exclude complete suffix labels, cover nested and lookalike names, and clarify the report scope. Run the Go tests in PR CI. All packages pass go test ./... locally.
68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
name: Test PR
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR base
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
path: base
|
|
|
|
- name: Checkout PR head
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
path: test
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: test/go.mod
|
|
cache-dependency-path: test/go.sum
|
|
|
|
- name: Build and test Go commands
|
|
working-directory: test
|
|
run: |
|
|
go build ./...
|
|
go test ./...
|
|
|
|
- name: Build .dat and .yml
|
|
run: |
|
|
[ -d ./base/data/ ] && [ -d ./test/data/ ] || exit 1
|
|
mv ./base/data/ ./test/basedata/
|
|
rm -rf ./base
|
|
cd test || exit 1
|
|
# Base files
|
|
go run ./main.go --datapath=./basedata --outputdir=../
|
|
go run ./cmd/datdump/main.go --inputdata=../dlc.dat --outputdir=../ --exportlists=_all_
|
|
rm -f ../dlc.dat
|
|
mv ../dlc.dat_plain.yml ../BASE-${{ github.run_number }}-dlc.yml
|
|
# Head files
|
|
go run ./main.go --datapath=./data --outputdir=../
|
|
go run ./cmd/datdump/main.go --inputdata=../dlc.dat --outputdir=../ --exportlists=_all_
|
|
mv ../dlc.dat ../TEST-${{ github.run_number }}-dlc.dat
|
|
mv ../dlc.dat_plain.yml ../TEST-${{ github.run_number }}-dlc.yml
|
|
cd ../ && rm -rf ./test
|
|
|
|
- name: Print plain diff
|
|
run: |
|
|
echo "Base: ${{ github.event.pull_request.base.sha }}"
|
|
echo "Head: ${{ github.event.pull_request.head.sha }}"
|
|
diff -us BASE-${{ github.run_number }}-dlc.yml TEST-${{ github.run_number }}-dlc.yml | tee TEST-${{ github.run_number }}-dlc.diff
|
|
rm -f BASE-${{ github.run_number }}-dlc.yml TEST-${{ github.run_number }}-dlc.yml
|
|
|
|
- name: Upload TEST-${{ github.run_number }} files
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: TEST-${{ github.run_number }}
|
|
path: |
|
|
TEST-${{ github.run_number }}-dlc.dat
|
|
TEST-${{ github.run_number }}-dlc.diff
|