Skip to content

Add yield_now_local #66

Add yield_now_local

Add yield_now_local #66

Workflow file for this run

name: loc
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'COPYRIGHT'
- 'LICENSE*'
- '**.md'
- '**.txt'
- 'art'
pull_request:
paths-ignore:
- 'README.md'
- 'COPYRIGHT'
- 'LICENSE*'
- '**.md'
- '**.txt'
- 'art'
workflow_dispatch:
jobs:
loc:
runs-on: ubuntu-latest
strategy:
matrix:
crates:
- name: agnostic
path: agnostic
- name: agnostic-lite
path: lite
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
rustup update stable && rustup default stable
rustup component add clippy
rustup component add rustfmt
- name: Install tokeit
run: |
cargo install tokeit --force
- name: Count lines of code
run: |
tokeit --label "Total lines of code"
- name: Upload loc to GitHub Gist
uses: actions/github-script@v6
with:
github-token: ${{secrets.GIST_PAT}}
script: |
const fs = require('fs');
const output = fs.readFileSync('tokeit.json', 'utf8');
const gistId = '327b2a8aef9003246e45c6e47fe63937';
await github.rest.gists.update({
gist_id: gistId,
files: {
"agnostic-total": {
content: output
}
}
});
console.log("Gist updated");
- name: Count lines of code in subcrates
run: |
for crate in agnostic lite; do
cd $crate
tokeit
cd ..
done
- name: Upload subcrates loc to GitHub Gist
uses: actions/github-script@v6
with:
github-token: ${{secrets.GIST_PAT}}
script: |
const fs = require('fs');
const output = fs.readFileSync('${{ matrix.crates.path }}/tokeit.json', 'utf8');
const gistId = '327b2a8aef9003246e45c6e47fe63937';
await github.rest.gists.update({
gist_id: gistId,
files: {
"${{ matrix.crates.name }}": {
content: output
}
}
});
console.log("Gist updated");