Repository navigation
103 lines (98 loc) · 3.75 KB
/
Copy pathcollect.yml
File metadata and controls
103 lines (98 loc) · 3.75 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: collect
# open-collect-pr.sh takes the task from this title, which the run can't change.
run-name: "collect ${{ inputs.task }}${{ inputs.task == 'ingest' && format(' {0}', inputs.category) || '' }}"
# Runs one of TechEngine's collectors by hand, on develop:
# ingest drafts new SKUs for one category from upstream catalogs
# refresh re-scrapes the benchmark sources into existing records
# promote runs the network verification (Tiers 1-3) and, with apply, flips
# `verified` on the records that pass
# Nothing here runs on a schedule, pushes, opens a PR or posts a comment, and
# the engine that runs is the TechEngine commit this repository pins as its
# submodule.
#
# The token is read-only. A run commits its data changes locally, runs the
# validators and the integrity gate, and uploads the commit as collect.patch in
# a collect-* artifact. A maintainer then opens the PR from their own account:
# bash .github/scripts/open-collect-pr.sh <run-id>
# so pr-checks runs on it like on any PR. Each task keeps at most one open PR,
# on a fixed collect/* branch that the script force-pushes and whose body it
# edits in place. Add the `final-check` label for the full build and the
# Tier 0-3 verification.
#
# The TechEngine workflows are pinned by commit SHA; bump it together with the
# submodule.
on:
workflow_dispatch:
inputs:
task:
description: "Collector to run"
type: choice
options: [ingest, refresh, promote]
default: ingest
category:
description: "ingest: category"
type: choice
options: [cpu, gpu, smartphone]
default: cpu
limit:
description: "ingest: max candidates per source"
type: string
default: "50"
include_drafts:
description: "ingest: also write incomplete records (the PR opens as a draft)"
type: boolean
default: false
sleep:
description: "refresh: seconds between requests"
type: string
default: "1.0"
apply:
description: "promote: flip verified and upload the patch (otherwise a dry run)"
type: boolean
default: false
max_urls:
description: "promote: records to URL-check"
type: string
default: "2000"
max_wikidata:
description: "promote: Wikidata items to check"
type: string
default: "20000"
max_crossref:
description: "promote: records to cross-reference"
type: string
default: "500"
permissions: {}
jobs:
ingest:
if: >-
github.repository == 'GetTechAPI/TechAPI' && github.ref == 'refs/heads/develop' &&
inputs.task == 'ingest'
permissions:
contents: read
uses: GetTechAPI/TechEngine/.github/workflows/ingest.yml@45090a02409b2418d156c6c0af77395e97d32050 # main, TechEngine #133
with:
category: ${{ inputs.category }}
limit: ${{ inputs.limit }}
include_drafts: ${{ inputs.include_drafts }}
refresh:
if: >-
github.repository == 'GetTechAPI/TechAPI' && github.ref == 'refs/heads/develop' &&
inputs.task == 'refresh'
permissions:
contents: read
uses: GetTechAPI/TechEngine/.github/workflows/refresh.yml@45090a02409b2418d156c6c0af77395e97d32050 # main, TechEngine #133
with:
sleep: ${{ inputs.sleep }}
promote:
if: >-
github.repository == 'GetTechAPI/TechAPI' && github.ref == 'refs/heads/develop' &&
inputs.task == 'promote'
permissions:
contents: read
uses: GetTechAPI/TechEngine/.github/workflows/verify-promote.yml@45090a02409b2418d156c6c0af77395e97d32050 # main, TechEngine #133
with:
apply: ${{ inputs.apply }}
max_urls: ${{ inputs.max_urls }}
max_wikidata: ${{ inputs.max_wikidata }}
max_crossref: ${{ inputs.max_crossref }}