diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fb74a88 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,14 @@ +name: CI +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Check package setup + run: python test.py \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000..082f83d --- /dev/null +++ b/test.py @@ -0,0 +1,46 @@ +from datetime import datetime, timedelta +import yaml + +with open('emoji.yaml') as f: + data = yaml.load(f, Loader=yaml.FullLoader) +available_dates = set(data.keys()) + +starting_date = '2024-01-01' +ending_date = '2024-12-31' + +class bcolors: + HEADER = '\033[95m' + OKBLUE = '\033[94m' + OKCYAN = '\033[96m' + OKGREEN = '\033[92m' + WARNING = '\033[93m' + FAIL = '\033[91m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m' + + +def generate_dates(year): + current_date = datetime(year, 1, 1) + while current_date != datetime(year, 12, 31): + d1 = current_date.strftime("%Y-%m-%d") + d2 = current_date.strftime("%m-%d") + current_date += timedelta(days=1) + yield d1,d2 + +count = 0 +month = "01" +for d1,d2 in generate_dates(datetime.now().year): + if month != d2.split("-")[0]: + month = d2.split("-")[0] + print() + date = d2.split("-")[1] + if d1 in available_dates or d2 in available_dates: + print(f"{bcolors.ENDC}{date}{bcolors.ENDC}",end=' ') + count+=1 + else: + print(f"{bcolors.FAIL}{date}{bcolors.ENDC}",end=' ') + +print(f"\n{count}/365 days covered") + +assert(count>=160) \ No newline at end of file