CIで検証する
このページは、Timeline DSL 利用者が自分のリポジトリで .tdsl ファイルを継続的に検証するための例です。Timeline DSL 本体やこのドキュメントサイトをデプロイする手順ではありません。
GitHub Actionsでは、.tdsl ファイルに対して tdsl check、tdsl lint、必要に応じて tdsl build を実行します。Wikidataを使うファイルを安定して検証したい場合は、build に --offline を付けて静的項目だけを処理できます。
Ubuntu runnerで検証する例
Section titled “Ubuntu runnerで検証する例”Ubuntu runner ではインストールスクリプトで tdsl を取得し、~/.local/bin を PATH に追加します。
name: Timeline DSL
on: pull_request: push: branches: [main]
jobs: tdsl: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Install tdsl run: | curl -sSfL https://raw.githubusercontent.com/keroway/timeline-dsl/main/install.sh | sh echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Check timeline run: tdsl check examples/china_dynasties.tdsl
- name: Lint timeline run: tdsl lint examples/china_dynasties.tdsl --format json
- name: Build JSON run: tdsl build examples/china_dynasties.tdsl --pretty --output timeline.jsonHomebrewでインストールする例
Section titled “Homebrewでインストールする例”macOS runner では Homebrew で導入できます。
jobs: tdsl: runs-on: macos-latest steps: - uses: actions/checkout@v4
- name: Install tdsl run: | brew tap keroway/tap brew install tdslWikidata import を含むファイル
Section titled “Wikidata import を含むファイル”ネットワーク取得を含めて検証する場合は通常の build または render を使います。CIの再現性を優先する場合は --offline を指定します。
tdsl build examples/china_with_import.tdsl --prettytdsl build examples/china_with_import.tdsl --offline --prettysearch、inspect、resolve、scaffold wikidata はWikidataまたはWikipediaへのネットワーク接続が必要です。