-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.81 KB
/
run.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
84
85
86
87
88
name: Run plugin-cargo
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main, feat/* ]
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
RUST_LOG: info
# database branch
DATABASE: debug
BOT: 1
# repos-default.json tag in database release
TAG_REPOS_DEFAULT: cache-v8.redb
# cache.redb tag in database release
TAG_CACHE: cache-v11.redb
CONFIGS: "repos-default.json repos-ui.json"
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Generate list.json
run: |
wget https://github.com/os-checker/database/releases/download/${{ env.TAG_REPOS_DEFAULT }}/repos-default.json
jq 'to_entries | map(.key) + ["os-checker/os-checker"]' repos-default.json > list.json
tree --help
tree --gitignore -h
- name: Install cargo-nextest
run: |
wget https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.81/cargo-nextest-0.9.81-x86_64-unknown-linux-gnu.tar.gz
tar xzvf cargo-nextest-0.9.81-x86_64-unknown-linux-gnu.tar.gz
mv cargo-nextest ~/.cargo/bin
- name: Install os-checker
run: |
wget https://raw.githubusercontent.com/os-checker/os-checker/refs/heads/main/assets/repos-ui.json
gh release download -R os-checker/database ${{ env.TAG_CACHE }} -p os-checker -D ~/.cargo/bin/
chmod +x ~/.cargo/bin/os-checker
os-checker layout --help
# - name: Test get_release_count
# run: cargo test -- test_get_release_count --nocapture
#
# - name: Test os-checker layout --list-targets
# run: cargo test -- test_sel4 --nocapture
#
# - name: Test pkg_targets
# run: cargo test -- test_pkg_targets --nocapture
- name: Install plugin-cargo
run: cargo install --path .
- name: Run plugin-cargo
run: |
os-checker-plugin-cargo #os-checker.json
tree --gitignore -h tmp
- name: Push to database
env:
PLUGIN_PATH: plugin/cargo
run: |
git config --global user.name "zjp-CN[bot]"
git config --global user.email "zjp-CN[bot]@users.noreply.github.com"
echo "正在 clone os-checker/database"
git clone https://x-access-token:${{ env.ACCESS_TOKEN }}@github.com/os-checker/database.git
echo "成功 clone os-checker/database"
cd database
git switch ${{ env.DATABASE }}
rm -rf ${{ env.PLUGIN_PATH }}
mkdir -p ${{ env.PLUGIN_PATH }}
mv ../tmp ${{ env.PLUGIN_PATH }}/info
cp ../push.sh ${{ env.PLUGIN_PATH }}
bash ${{ env.PLUGIN_PATH }}/push.sh