Add getLoggers() to list loggers in a category tree #863
Workflow file for this run
This file contains hidden or 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: main | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| tags: | |
| - "*.*.*" | |
| branches: | |
| - "*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| MISE_EXPERIMENTAL: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: &mise_options | |
| experimental: true | |
| install: true | |
| - run: mise run check | |
| test-deno: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| steps: | |
| - run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: *mise_options | |
| - run: deno task test --coverage=.cov --junit-path=.test-report.xml | |
| - uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: runner.os == 'Linux' && always() | |
| with: | |
| check_name: "Test Results (Linux)" | |
| files: .test-report.xml | |
| - uses: EnricoMi/publish-unit-test-result-action/macos@v2 | |
| if: runner.os == 'macOS' && always() | |
| with: | |
| check_name: "Test Results (macOS)" | |
| files: .test-report.xml | |
| - uses: EnricoMi/publish-unit-test-result-action/windows@v2 | |
| if: runner.os == 'Windows' && always() | |
| with: | |
| check_name: "Test Results (Windows)" | |
| files: .test-report.xml | |
| - if: runner.os == 'Linux' && !cancelled() | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: .test-report.xml | |
| - if: runner.os == 'Linux' | |
| run: deno coverage --lcov .cov > .cov.lcov | |
| - if: runner.os == 'Linux' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: dahlia/logtape | |
| file: .cov.lcov | |
| test-node: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| steps: | |
| - run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: *mise_options | |
| - run: mise run build | |
| - run: mise run test:node | |
| test-bun: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| steps: | |
| - run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: *mise_options | |
| - run: mise run build | |
| - run: mise run test:bun | |
| publish: | |
| if: github.event_name == 'push' | |
| needs: [check, test-deno, test-node, test-bun] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: *mise_options | |
| - run: | | |
| set -ex | |
| if [[ "$GITHUB_REF_TYPE" == tag ]]; then | |
| mise run check-versions | |
| [[ "$(jq -r '.version' packages/logtape/deno.json)" == "$GITHUB_REF_NAME" ]] | |
| else | |
| v="$(jq \ | |
| --raw-output \ | |
| --arg build "$GITHUB_RUN_NUMBER" \ | |
| --arg commit "${GITHUB_SHA::8}" \ | |
| '.version + "-dev." + $build + "+" + $commit' \ | |
| packages/logtape/deno.json)" | |
| deno run --allow-read --allow-write scripts/update_versions.ts "$v" | |
| mise run check-versions | |
| fi | |
| - run: mise run build | |
| - run: | | |
| set -ex | |
| if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then | |
| pnpm publish -r --filter './packages/*' --force --no-git-checks --access public --tag latest | |
| else | |
| pnpm publish -r --filter './packages/*' --force --no-git-checks --access public --tag dev | |
| fi | |
| env: | |
| NPM_CONFIG_PROVENANCE: "true" | |
| # jsr.io is unstable these days and deno publish often hangs, so cap | |
| # each attempt at 1 minute and retry up to 30 times. | |
| - run: | | |
| set -x | |
| for i in $(seq 1 30); do | |
| if timeout 1m deno publish --allow-dirty; then | |
| exit 0 | |
| fi | |
| echo "deno publish failed or timed out (attempt $i/30); retrying..." >&2 | |
| sleep 5 | |
| done | |
| echo "deno publish failed after 30 attempts" >&2 | |
| exit 1 | |
| publish-docs: | |
| if: github.event_name == 'push' | |
| needs: [publish] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| id-token: write | |
| pages: write | |
| deployments: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v4 | |
| with: *mise_options | |
| - run: mise run build | |
| - run: | | |
| set -ex | |
| if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then | |
| EXTRA_NAV_TEXT=Unstable \ | |
| EXTRA_NAV_LINK="$UNSTABLE_DOCS_URL" \ | |
| SITEMAP_HOSTNAME="$STABLE_DOCS_URL" \ | |
| pnpm build | |
| else | |
| EXTRA_NAV_TEXT=Stable \ | |
| EXTRA_NAV_LINK="$STABLE_DOCS_URL" \ | |
| SITEMAP_HOSTNAME="$UNSTABLE_DOCS_URL" \ | |
| pnpm build | |
| fi | |
| env: | |
| STABLE_DOCS_URL: ${{ vars.STABLE_DOCS_URL }} | |
| UNSTABLE_DOCS_URL: ${{ vars.UNSTABLE_DOCS_URL }} | |
| PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }} | |
| working-directory: ${{ github.workspace }}/docs/ | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| - id: deployment | |
| if: github.ref_type == 'tag' | |
| uses: actions/deploy-pages@v4 | |
| - if: github.ref_type == 'branch' | |
| uses: nwtgck/actions-netlify@v3.0 | |
| with: | |
| publish-dir: docs/.vitepress/dist | |
| production-branch: main | |
| github-token: ${{ github.token }} | |
| enable-pull-request-comment: false | |
| enable-commit-comment: false | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
| timeout-minutes: 2 |