Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2025 Starting With ChoreoLib #10

Merged
merged 9 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand All @@ -15,20 +15,48 @@ jobs:
run-json-checker:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Get the ubuntu-base docker image
#container: wpilib/ubuntu-base:18.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so we can use git diff

# Installs dependencies
- name: Install dependencies
run: sudo pip3 install pyelftools pefile

# Runs check
- name: Run check
run: |
./check.py **/*.json
# Determine the base commit
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch --no-tags --prune --progress --no-recurse-submodules origin ${{ github.base_ref }}
BASE_COMMIT=$(git merge-base HEAD origin/${{ github.base_ref }})
else
BASE_COMMIT=${{ github.event.before }}
fi
echo "Base commit: $BASE_COMMIT"

# Get list of added or modified JSON files in subdirectories
git diff --diff-filter=AM --name-only $BASE_COMMIT HEAD | grep '.*/.*\.json$' > changed_json_files.txt

# Output the list of files
echo "Changed JSON files in subdirectories:"
cat changed_json_files.txt

# Run check.py on each existing JSON file
if [ -s changed_json_files.txt ]; then
while read -r file; do
if [ -f "$file" ]; then
if [ -s "$file" ]; then
echo "Processing $file"
./check.py "$file"
else
echo "Warning: $file is empty."
fi
else
echo "Warning: $file does not exist."
fi
done < changed_json_files.txt
else
echo "No JSON files changed in subdirectories"
fi
10 changes: 10 additions & 0 deletions 2025.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"path": "2025/NavX-2025.1.1-beta-1.json",
"name": "NavX",
"version": "2025.1.1-beta-1",
"uuid": "cb311d09-36e9-4143-a032-55bb2b94443b",
"description": "Libraries for NavX-MXP and NavX-Micro",
"website": "https://pdocs.kauailabs.com/navx-mxp/software/roborio-libraries/"
}
]
39 changes: 39 additions & 0 deletions 2025/NavX-2025.1.1-beta-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"fileName": "NavX-2025.1.1-beta-1.json",
"name": "navx_frc",
"version": "2025.1.1-beta-1",
"uuid": "cb311d09-36e9-4143-a032-55bb2b94443b",
"frcYear": "2025",
"mavenUrls": [
"https://dev.studica.com/maven/release/2025/"
],
"jsonUrl": "https://dev.studica.com/releases/2025/NavX-2025.1.1-beta-1.json",
"javaDependencies": [
{
"groupId": "com.kauailabs.navx.frc",
"artifactId": "navx_frc-java",
"version": "2025.1.1-beta-1"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.kauailabs.navx.frc",
"artifactId": "navx_frc-cpp",
"version": "2025.1.1-beta-1",
"headerClassifier": "headers",
"sourcesClassifier": "sources",
"sharedLibrary": false,
"libName": "navx_frc",
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"linuxarm32",
"linuxarm64",
"linuxx86-64",
"osxuniversal",
"windowsx86-64"
]
}
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Each year (e.g. competition season) has a JSON file at the root level (named `YE
The root-level `YEAR.json` files (e.g. `2024.json`) provide the master directory of available vendor libraries. It's intended to be used by IDEs such as Visual Studio Code to present a user-friendly list of available vendor libraries.

This json file consists of a list of dicts with the following keys:
* path: the path within the repository to the vendor JSON file (e.g. `2024/vendor.json`)
* name: the same as the name in the vendor JSON file
* path: the path within the repository to the vendor JSON file (e.g. `2024/<vendor>-<version>.json`)
* name: the same as the name in the vendor JSON file (`<vendor>-<version>.json`)
* uuid: the same as the uuid in the vendor JSON file
* description: a user-friendly brief description of the library -- intended to be displayed to users in list format
* website: URL of the vendor website (e.g. a site with documentation / tutorials / tools installers)
* website: URL of the vendor's website (e.g. a site with documentation / tutorials / tools installers)

## JSON checker

Expand Down
6 changes: 3 additions & 3 deletions check.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def info(s):

verbose = 0
local_maven = None
year = "2019"
year = "2025"

def parse_args():
"""Parse command line arguments. Returns list of filenames."""
Expand All @@ -76,7 +76,7 @@ def parse_args():
global verbose, local_maven, year
verbose = args.verbose or 0
local_maven = args.local_maven
year = args.year or "2019"
year = args.year or "2025"

return args.file

Expand Down Expand Up @@ -293,7 +293,7 @@ def check_cpp_shared_linux(libf, arch, debug):
'wpiutil',
])
if arch == 'athena':
if year == "2019":
if year == "2025":
exclude_libs.update([
'libNiFpga.so.13',
'libNiFpgaLv.so.13',
Expand Down