generated from al8n/crates
-
-
Notifications
You must be signed in to change notification settings - Fork 6
83 lines (76 loc) · 2.12 KB
/
loc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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: [txn, async-txn, wmark, txn-core, skipdb, async-skipdb, skipdb-core]
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 total lines of code
run: |
tokeit -l "Total lines of code"
- name: Upload total 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: {
"skipdb-total": {
content: output
}
}
});
- name: Count lines of code in subcrates
run: |
tokeit
working-directory: ${{ matrix.crates }}
- 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 }}/tokeit.json', 'utf8');
const gistId = '327b2a8aef9003246e45c6e47fe63937';
await github.rest.gists.update({
gist_id: gistId,
files: {
"${{ matrix.crates }}": {
content: output
}
}
});