Skip to content

Commit 94eb079

Browse files
committed
ci: probe the OSS Scanner image (temporary)
1 parent c566973 commit 94eb079

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OSS Scanner probe
2+
on:
3+
push:
4+
branches: [chore/oss-scanner-probe]
5+
permissions:
6+
contents: read
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 60
11+
steps:
12+
- name: Make room, as anthropics/oss-scanner build.yaml does
13+
run: |
14+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
15+
df -h /
16+
- name: Prepare tools/check
17+
run: |
18+
git clone --depth 1 https://github.com/anthropics/oss-scanner.git
19+
mkdir -p oss-scanner/projects/tablepro
20+
printf '%s\n' \
21+
"repo: https://github.com/TableProApp/TablePro#${GITHUB_REF_NAME}" \
22+
"primary_contact: hello@tablepro.app" \
23+
"homepage: https://tablepro.app" \
24+
"dockerfile: .oss-scanner/Dockerfile" \
25+
"threat_model: .oss-scanner/threat_model.md" > oss-scanner/projects/tablepro/project.yaml
26+
python3 -c 'import yaml' || pip install pyyaml
27+
- name: tools/check --no-shell
28+
run: |
29+
( while sleep 60; do echo "disk: $(df -h / | awk 'NR==2{print $3" used, "$4" free"}')"; done ) &
30+
start=$(date +%s)
31+
cd oss-scanner && python3 tools/check --no-shell tablepro
32+
echo "build seconds: $(( $(date +%s) - start ))"
33+
df -h /
34+
docker system df
35+
- name: Offline checks, agent limits
36+
run: |
37+
cat > probe.sh <<'EOF'
38+
set -u
39+
du -sh /src/linux/_build/cargo-target /src/linux/_build/cargo-home /src/.oss-scanner/swift/.build 2>/dev/null
40+
echo "== cargo offline after an edit"
41+
cd /src/linux && touch crates/core/src/lib.rs
42+
time meson devenv -C _build cargo test --locked -p tablepro-core 2>&1 | grep -E '^test result|Compiling tablepro' | head -5
43+
echo "== swift offline after an edit"
44+
cd /src/.oss-scanner/swift && touch Sources/TableProSQLGrammar/SqlLexer.swift
45+
swift test 2>&1 | grep -E 'Test run with|error:' | head -5
46+
EOF
47+
docker run --rm --network none --cpus 2 --memory 8g -v "$PWD/probe.sh:/probe.sh:ro" -w /src oss-scanner-check/built:tablepro bash /probe.sh

0 commit comments

Comments
 (0)