Skip to content

Commit

Permalink
feat: support skipped or unlimited testbed
Browse files Browse the repository at this point in the history
also add `-1` support for query limit
  • Loading branch information
tydeu committed Dec 7, 2023
1 parent a72032a commit 1bf131d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ jobs:
testbed:
needs: index
# Run even if `index` is skipped
if: (!failure() && !cancelled())
if: (!failure() && !cancelled() && inputs.testbed-size != 0)
name: Testbed
uses: ./.github/workflows/testbed.yaml
secrets: inherit
with:
index-repo: ${{ inputs.index-repo }}
testbed-size: ${{ inputs.testbed-size || 0 }}
testbed-size: ${{ inputs.testbed-size || (github.ref_name == 'master' && 200 || 0) }}
toolchain: ${{ inputs.toolchain }}
update-index: ${{ inputs.save-testbed == true }}
pages:
needs: [index, testbed]
# Run even if `index` is skipped
# Run even if `index` or `testbed` is skipped
if: (!failure() && !cancelled())
name: Pages
uses: ./.github/workflows/pages.yaml
secrets: inherit
with:
index-repo: ${{ inputs.index-repo }}
testbed-artifact: ${{ !(inputs.index-repo && inputs.save-testbed) }}
testbed-artifact: ${{ !(inputs.index-repo && inputs.save-testbed) && inputs.testbed-size != 0 }}
2 changes: 1 addition & 1 deletion .github/workflows/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
./query.py -v \
${{ inputs.repository && '-D index' || '-o index.json' }} \
-L ${{ (!inputs.repository && github.ref_name != 'master') && 100 || 0 }}
-L ${{ (!inputs.repository && github.ref_name != 'master') && 100 || -1 }}
env:
GH_TOKEN: ${{ github.token }}
- name: Update Index Repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ jobs:
./testbed-create.py -o matrix.json \
${{ inputs.index-repo && 'index' || 'index.json' }} \
${{ inputs.toolchain || steps.find-toolchain.outputs.toolchain }} \
-n ${{inputs.testbed-size || (github.ref_name == 'master' && 200 || 15)}} \
-X ${{github.ref_name == 'master' && 'testbed-exclusions.txt' || 'testbed-dev-exclusions.txt'}}
-n ${{ inputs.testbed-size || 10 }} \
-X ${{ github.ref_name == 'master' && 'testbed-exclusions.txt' || 'testbed-dev-exclusions.txt' }}
- name: Upload Matrix
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion query.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def query_repo_data(repoIds: 'list[str]') -> dict:
# Thus, the strategy used here will need to change when we hit that limit.
def query_lake_repos(limit: int) -> 'list[str]':
query='filename:lakefile.lean path:/'
if limit == 0:
if limit <= 0:
out = capture_cmd(
'gh', 'api', 'search/code',
'--paginate', '--cache', '1h',
Expand Down
4 changes: 3 additions & 1 deletion testbed-create.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def create_entry(pkg: 'dict[str, any]'):
pkgs = load_index(args.index)
pkgs = filter(lambda pkg: pkg['fullName'] not in exclusions, pkgs)
pkgs = map(create_entry, pkgs)
pkgs = list(itertools.islice(pkgs, args.num))
if args.num != -1:
pkgs = itertools.islice(pkgs, args.num)
pkgs = list(pkgs)

if args.output is None:
print(json.dumps(pkgs))
Expand Down

0 comments on commit 1bf131d

Please sign in to comment.