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

Commit

Permalink
Merge pull request #5 from YuGiOhBot3000/chore/migrate-to-github-actions
Browse files Browse the repository at this point in the history
Chore: Migrate to Github Actions
  • Loading branch information
Tohaker authored Oct 3, 2020
2 parents d6d1735 + 8edc9ec commit a5ee2e3
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 66 deletions.
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.

0 comments on commit a5ee2e3

Please sign in to comment.