test download recent data #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cron Update Data | |
on: | |
schedule: | |
- cron: "0 0 * * 1" | |
push: | |
jobs: | |
Test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.22 | |
id: go | |
- name: Get dependencies | |
run: go get -v -t -d ./... | |
- name: Download Database | |
uses: robinraju/release-downloader@v1 | |
with: | |
tag: "db" | |
fileName: "tenhou*" | |
out-file-path: "./data" | |
extract: true | |
- name: unzip data | |
run: unzip ./data/tenhou_data.zip | |
- run: mkdir ./data/tenhou_html && ls -al ./data | |
- name: download recent data | |
run: go run ./cmd download_recent | |
- run: ls -al ./data/tenhou_html | |
- name: store to db | |
run: go run ./cmd recent_html_to_db | |
- name: zip | |
run: zip ./data/tenhou_data.zip ./data/tenhou_data.db | |
- name: rename db | |
run: mv ./data/tenhou_data.db ./data/tenhou_data.$(date +'%Y%m%d').db | |
- name: zip | |
run: zip ./data/tenhou_data.$(date +'%Y%m%d').zip ./data/tenhou_data.$(date +'%Y%m%d').db | |
- run: ls -al ./data |