mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-06-08 02:14:53 +00:00
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Validation
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "domains/*"
|
|
- "tests/*"
|
|
- "util/*"
|
|
- ".github/workflows/validation.yml"
|
|
- "dnsconfig.js"
|
|
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.ref }}-validation
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
dns:
|
|
name: DNS
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check
|
|
uses: is-a-dev/dnscontrol-action@main
|
|
with:
|
|
args: check
|
|
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Get Modified JSON Files
|
|
id: modified_files
|
|
run: |
|
|
MODIFIED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^domains/.*\.json$' | sed 's|.*/||' | tr '\n' ',' | sed 's|,$||')
|
|
echo "MODIFIED_FILES=${MODIFIED_FILES}" >> $GITHUB_ENV
|
|
|
|
- run: npm install
|
|
|
|
- run: npm test
|
|
env:
|
|
PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
|
MODIFIED_FILES: ${{ env.MODIFIED_FILES }}
|