Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
61 lines (58 loc) · 2.33 KB
/
Copy pathaction.yml
File metadata and controls
61 lines (58 loc) · 2.33 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
name: leCop
description: Check a LeRobot dataset for broken episodes, in milliseconds.
author: michele-xilo
branding:
icon: check-circle
color: gray-dark
inputs:
path:
description: Dataset directory, or a directory to search for datasets.
default: .
version:
description: leCop version to install, such as 0.3.0, or latest.
default: latest
args:
description: Extra flags for `lecop validate`, such as `--ignore idle_episode` or `--decode`.
default: ""
runs:
using: composite
steps:
- name: Install leCop
shell: bash
env:
VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
ext=tar.xz
case "$RUNNER_OS-$RUNNER_ARCH" in
Linux-X64) target=x86_64-unknown-linux-gnu ;;
Linux-ARM64) target=aarch64-unknown-linux-gnu ;;
macOS-X64) target=x86_64-apple-darwin ;;
macOS-ARM64) target=aarch64-apple-darwin ;;
Windows-X64) target=x86_64-pc-windows-msvc; ext=zip ;;
*) echo "::error::leCop has no release binary for $RUNNER_OS $RUNNER_ARCH"; exit 1 ;;
esac
base=https://github.com/michele-xilo/leCop/releases
if [ "$VERSION" = latest ]; then url="$base/latest/download"; else url="$base/download/v${VERSION#v}"; fi
dir="$RUNNER_TEMP/lecop"
mkdir -p "$dir"
cd "$dir"
curl -fsSLO "$url/lecop-$target.$ext"
curl -fsSLO "$url/lecop-$target.$ext.sha256"
if command -v sha256sum >/dev/null; then sha256sum -c "lecop-$target.$ext.sha256"; else shasum -a 256 -c "lecop-$target.$ext.sha256"; fi
if [ "$ext" = zip ]; then unzip -q "lecop-$target.zip" -d "lecop-$target"; else tar -xJf "lecop-$target.tar.xz"; fi
# The Windows zip has no top-level folder, the tarballs do.
bin="$dir/lecop-$target"
if command -v cygpath >/dev/null; then bin=$(cygpath -w "$bin"); fi
echo "$bin" >> "$GITHUB_PATH"
# `github` format puts each finding on the pull request as an annotation. Exit 1 on errors fails the step;
# warnings do not (promote one with `error = [...]` in lecop.toml).
- name: Check the dataset
shell: bash
env:
DATASET: ${{ inputs.path }}
EXTRA_ARGS: ${{ inputs.args }}
run: |
set -f
# shellcheck disable=SC2086
lecop validate --format github $EXTRA_ARGS -- "$DATASET"