Skip to content

Commit

Permalink
Removed redundant JSONs and Pickles due to shift to using submodule p…
Browse files Browse the repository at this point in the history
…ickles and dataclass
  • Loading branch information
Zanger67 committed Jul 20, 2024
1 parent 7ccd03a commit 6abe07e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
108 changes: 54 additions & 54 deletions .github/workflows/update_questiondata.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
name: '[Updating LeetCode question data]'
# name: '[Updating LeetCode question data]'

on:
schedule:
- cron: "15 5 * * 0" # runs at 5:15 am UTC on SUNDAYS
# matches my 'leetcode question-data'
# repo's schedule with a slight delay to allow
# for the request to occur
#
# Chose this due to contests being on Saturday
# at 2:30 am UTC
# on:
# schedule:
# - cron: "15 5 * * 0" # runs at 5:15 am UTC on SUNDAYS
# # matches my 'leetcode question-data'
# # repo's schedule with a slight delay to allow
# # for the request to occur
# #
# # Chose this due to contests being on Saturday
# # at 2:30 am UTC

workflow_dispatch:
# workflow_dispatch:

permissions:
contents: write
# permissions:
# contents: write


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the current repository content
uses: actions/checkout@v2
with:
submodules: "true"
token: ${{ secrets.PAT }}
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout the current repository content
# uses: actions/checkout@v2
# with:
# submodules: "true"
# token: ${{ secrets.PAT }}

- name: Pull updated question data submodule | Adding it as a submodule if not present
run: |
if [ -d question_data/question_data/ ]; then
echo "Submodule exists."
git submodule update --recursive --remote
else
echo "Submodule not found. Adding..."
git submodule add https://github.com/Zanger67/leetcode-question-data.git 'question_data/question_data'
git submodule update --init --recursive
fi
# - name: Pull updated question data submodule | Adding it as a submodule if not present
# run: |
# if [ -d question_data/question_data/ ]; then
# echo "Submodule exists."
# git submodule update --recursive --remote
# else
# echo "Submodule not found. Adding..."
# git submodule add https://github.com/Zanger67/leetcode-question-data.git 'question_data/question_data'
# git submodule update --init --recursive
# fi

- name: Copy the new JSON file
run: |
cp 'question_data/question_data/data/leetcode_oneline.json' 'question_data/leetcode_data.json'
# - name: Copy the new JSON file
# run: |
# cp 'question_data/question_data/data/leetcode_oneline.json' 'question_data/leetcode_data.json'

- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
# - name: Setup python 3.10
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# cache: "pip"

- name: Install python packages
run: |
python -m pip install --upgrade pip
pip install -r 'requirements.txt'
# - name: Install python packages
# run: |
# python -m pip install --upgrade pip
# pip install -r 'requirements.txt'


- name: Parse newly imported data
run: |
python parse_official_question_data.py
# - name: Parse newly imported data
# run: |
# python parse_official_question_data.py

- name: Commit and push the updated JSON file
run: |
git config --global user.name "Zanger67/wikileet"
git config --global user.email "Zanger67[bot]@Zanger67.github.io"
git add .
git commit -m '[Weekly question data pickle update]' || exit 0
git push
# - name: Commit and push the updated JSON file
# run: |
# git config --global user.name "Zanger67/wikileet"
# git config --global user.email "Zanger67[bot]@Zanger67.github.io"
# git add .
# git commit -m '[Weekly question data pickle update]' || exit 0
# git push
1 change: 0 additions & 1 deletion question_data/leetcode_data.json

This file was deleted.

Binary file removed question_data/leetcode_question_details.pkl
Binary file not shown.
Binary file removed question_data/leetcode_question_topics.pkl
Binary file not shown.

0 comments on commit 6abe07e

Please sign in to comment.