Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Chore: Migrate to Github Actions #5

Merged
merged 3 commits into from
Oct 3, 2020
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
74 changes: 74 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CD

on:
push:
branches:
master

jobs:
build:
env:
PYTHONPATH: yugiohbot
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
ACCESS_TOKEN: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
PAGE_ID: ${{ secrets.FACEBOOK_PAGE_ID }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- uses: hashicorp/setup-terraform@v1
- run: terraform --version

- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true

- name: Install GCP Components
run: |
gcloud info
gcloud --quiet components install beta
gcloud --quiet components update

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r yugiohbot/requirements.txt
pip install pytest-cov codecov pandas

- name: Download NLTK
run: |
python -m nltk.downloader punkt averaged_perceptron_tagger wordnet

- name: Create Data
run: |
python -c "import data; data.utilities.import_from_api()"
python -c "import data; data.utilities.label_effects()"
python -c "import data; data.utilities.label_flavour_text()"
mkdir -p yugiohbot/resources
cp cards_api.csv yugiohbot/resources/
cp effect_order.csv yugiohbot/resources/
cp flavour_list.csv yugiohbot/resources/

- name: Run Tests
run: pytest --cov=./

- name: Report coverage
run: codecov

- name: Setup Deployment
run: |
mkdir -p deployment/function/nltk_data
cp -a ~/nltk_data/. deployment/function/nltk_data/
cp -a yugiohbot/. deployment/function/
chmod +x ./deployment/deploy.sh

- name: Run Deployment
run: deployment/deploy.sh
44 changes: 44 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on: [push, pull_request]

jobs:
build:
env:
PYTHONPATH: yugiohbot
ACCESS_TOKEN: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
PAGE_ID: ${{ secrets.FACEBOOK_PAGE_ID }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r yugiohbot/requirements.txt
pip install pytest-cov codecov pandas

- name: Download NLTK
run: |
python -m nltk.downloader punkt averaged_perceptron_tagger wordnet

- name: Create Data
run: |
python -c "import data; data.utilities.import_from_api()"
python -c "import data; data.utilities.label_effects()"
python -c "import data; data.utilities.label_flavour_text()"
mkdir -p yugiohbot/resources
cp cards_api.csv yugiohbot/resources/
cp effect_order.csv yugiohbot/resources/
cp flavour_list.csv yugiohbot/resources/

- name: Run Tests
run: pytest --cov=./

- name: Report coverage
run: codecov
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion deployment/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ terraform {
backend "gcs" {
bucket = "yugiohbot-tf-state"
prefix = "title-text"
credentials = "~/account.json"
}
}
11 changes: 11 additions & 0 deletions deployment/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_providers {
archive = {
source = "hashicorp/archive"
}
google = {
source = "hashicorp/google"
}
}
required_version = ">= 0.13"
}
Binary file removed gcp_terraform.json.enc
Binary file not shown.
Binary file added yugiohbot/__init__.pyc
Binary file not shown.
Binary file added yugiohbot/main.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion yugiohbot/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ textblob
pandas
requests
textgenrnn
tensorflow==1.14
tensorflow==2.2.0
keras==2.2.0
Binary file added yugiohbot/tests/__init__.pyc
Binary file not shown.
Binary file added yugiohbot/text/__init__.pyc
Binary file not shown.
Binary file added yugiohbot/title/__init__.pyc
Binary file not shown.
Binary file added yugiohbot/title/title.pyc
Binary file not shown.