mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 19:33:10 +00:00
89 lines
2.1 KiB
YAML
89 lines
2.1 KiB
YAML
version: 2.1
|
|
|
|
jobs:
|
|
test:
|
|
docker:
|
|
- image: cimg/python:3.10.9
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Pull Submodules
|
|
command: |
|
|
git submodule init
|
|
git submodule update --remote
|
|
- run:
|
|
name: Install deps
|
|
command: make dev-install
|
|
- run:
|
|
name: Linting
|
|
command: make format-check
|
|
- run:
|
|
name: Run tests
|
|
command: make test
|
|
build:
|
|
docker:
|
|
- image: cimg/python:3.10.9
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Pull Submodules
|
|
command: |
|
|
git submodule init
|
|
git submodule update --remote
|
|
- run:
|
|
name: Install deps
|
|
command: make install
|
|
- run:
|
|
name: Run migrations
|
|
command: make setup
|
|
- run:
|
|
name: Build database
|
|
command: make build-db
|
|
|
|
deploy:
|
|
machine:
|
|
image: ubuntu-2004:202111-01 # https://circleci.com/docs/2.0/configuration-reference/#available-machine-images with Docker 18.09.3. Newer images don't work
|
|
resource_class: large
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Pull Submodules
|
|
command: |
|
|
git submodule init
|
|
git submodule update --remote
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- "d3:5f:9d:68:ea:12:9a:42:d3:d3:e1:db:b0:6a:fc:d2"
|
|
- run:
|
|
name: Generate new data, push to PokeAPI/api-data's staging branch, if master open a Pull Request towards PokeAPI/api-data's master branch
|
|
command: bash -x Resources/scripts/updater.sh
|
|
|
|
workflows:
|
|
version: 2
|
|
test-and-deploy:
|
|
jobs:
|
|
- test
|
|
- build
|
|
- deploy:
|
|
requires:
|
|
- test
|
|
- build
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- staging
|
|
weekly:
|
|
jobs:
|
|
- test
|
|
- build
|
|
- deploy:
|
|
requires:
|
|
- test
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 0 * * 1"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- staging
|