chore(deps): update dependency deno to v2.1.3 (#180) #502
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-deno-with-cache | |
- id: fmt | |
run: deno fmt --check | |
- id: lint | |
run: deno lint | |
check-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-deno-with-cache | |
- name: Rebuild the dist/ directory | |
run: deno task bundle | |
# post processes | |
- name: Upload dist for post job | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: js_dist | |
path: | | |
dist/ | |
action.yml | |
- name: Create dist/*.js size json | |
run: | | |
find ./dist -type f -printf '%s %f\n' \ | |
| jq -n -R '{name: "dist_size", key: "dist_size", metrics: [inputs | capture("(?<value>\\S+)\\s+(?<key>.+)") + {unit: "KB"} | .value |= tonumber / 1024 | .name = .key ]}' \ | |
> dist_js_sizes.json | |
cat dist_js_sizes.json | |
# octocov must needs some coverage files but this job don't exec test, so put dummy file. | |
- name: Create dummy coverage | |
run: touch coverage.out | |
- uses: k1LoW/octocov-action@v1 | |
env: | |
OCTOCOV_CUSTOM_METRICS_DIST_JS: dist_js_sizes.json | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-deno-with-cache | |
- run: deno test --allow-env | |
- name: CLI somke test | |
run: | | |
RUN_URL=$(gh run list -L 1 -w release --json url --jq .[].url) | |
deno run --allow-net --allow-write --allow-env=GITHUB_API_URL cli.ts -t "${GITHUB_TOKEN}" -o output.md $RUN_URL | |
cat output.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run_self: | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
needs: [check, check-dist, test] | |
steps: | |
- name: Download bundled dist | |
uses: actions/download-artifact@v4 | |
with: | |
name: js_dist | |
- name: Run self action with no options | |
uses: ./ | |
- name: Run self action with 'show-waiting-runner=false' | |
uses: ./ | |
with: | |
show-waiting-runner: false |