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
SELECT -- required, contains column names comma separated, if you need everything then use * | |
FROM -- required, name of the sheet | |
WHERE -- optional, generally contains the filtering criteria | |
ORDER BY -- optional, used for sorting. Default is low to high. if high to low needed use `desc` | |
GROUP BY -- optional, used for pivot table kind of query | |
HAVING -- optional, filtering on the group by |
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
# contents-truncated | |
# three job definition | |
jobs: | |
health-check-job: # health check job for testing and code formatting check | |
runs-on: ubuntu-latest # os for running the job | |
services: | |
postgres: # we need a postgres docker image to be booted a side car service to run the tests that needs a db | |
image: postgres | |
env: # the environment variable must match with app/settings.py if block of DATBASES variable otherwise test will fail due to connectivity issue. |
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 of our workflow | |
name: Django CI/CD Workflow | |
# triggers for our workflow | |
on: | |
# opening a pull request to master and develop branch will be a trigger | |
pull_request: | |
branches: | |
- develop | |
- master |
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 of our workflow | |
name: Django CI/CD Workflow | |
# triggers for our workflow | |
on: | |
# opening a pull request to master and develop branch will be a trigger | |
pull_request: | |
branches: | |
- develop | |
- master |
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
# truncated upper definition | |
# three job definition | |
jobs: | |
health-check-job: # health check job for testing and code formatting check | |
# truncated upper definition | |
- name: Run Test # running tests | |
run: pip manage.py test # we intentionally made an error. Instead of python we used pip. | |
- uses: nashmaniac/create-issue-action | |
if: ${{ failed() }} # only run when this job is failed. | |
name: Create Issue Action |
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: Test Workflow | |
on: push | |
jobs: | |
first-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run Action | |
# we can give directory path that contains action.yaml or repo address in username/repository_name@version format |
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
import os | |
import github | |
# extracting all the input from environments | |
title = os.environ['INPUT_TITLE'] | |
token = os.environ['INPUT_TOKEN'] | |
labels = os.environ['INPUT_LABELS'] | |
assignees = os.environ['INPUT_ASSIGNEES'] | |
body = os.environ['INPUT_BODY'] |
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
# action will be run in python3 container | |
FROM python:3 | |
# copying requirements.txt and install the action dependencies | |
COPY requirements.txt /requirements.txt | |
RUN pip install -r /requirements.txt | |
# script.py is the file that will contain the codes that we want to run for this action. | |
COPY script.py /script.py | |
# we will just run our script.py as our docker entrypoint by python script.py | |
CMD ["python", "/script.py"] |
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
# every action has a name | |
name: Create Issue Action | |
# description | |
description: This action creates an issue based on user inputs | |
# input parameters to be taken from user | |
inputs: | |
title: # name of variable. In action script it will be available in workflow as environment variable with name INPUT_TITLE | |
required: true # required variable possible values are true or false | |
description: Title of the issue | |
token: # token variable available in workflow as env var named INPUT_TOKEN |
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 of our workflow | |
name: Django CI/CD Workflow | |
# triggers for our workflow | |
on: | |
# opening a pull request to master and develop branch will be a trigger | |
pull_request: | |
branches: | |
- develop | |
- master |
NewerOlder