RcGcDw/.gitlab-ci.yml

54 lines
1.2 KiB
YAML
Raw Permalink Normal View History

image: python:3.7-alpine
2019-02-13 00:18:15 +00:00
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
2021-05-18 13:04:12 +00:00
stages:
- build
2021-05-18 13:04:12 +00:00
- test
- pytest
cache:
paths:
- settings.json
- .cache/pip
- venv/
2021-05-18 13:04:12 +00:00
test:
2021-05-22 12:23:49 +00:00
stage: test
2021-05-18 13:04:12 +00:00
script:
- apk add libxml2-dev libxslt-dev libxml2 gcc musl-dev linux-headers
- pip3.7 install virtualenv
- virtualenv venv
- source venv/bin/activate
2021-05-18 13:04:12 +00:00
- pip3.7 install -r requirements.txt
- sed -i -e "s/111111111111111111/$DISCORD1/g" settings.json.example
- sed -i -e "s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/$DISCORD2/g" settings.json.example
- mv settings.json.example settings.json
- python3.7 start.py --test
only:
- testing
2021-05-01 14:47:33 +00:00
pytest:
2021-05-22 12:23:49 +00:00
stage: pytest
2021-05-22 16:47:13 +00:00
needs: ['test']
2021-05-01 14:47:33 +00:00
script:
- source venv/bin/activate
- pip3.7 install -U pytest
2022-01-06 14:45:22 +00:00
- PYTHONPATH=. pytest --junit-xml=report.xml
2021-05-01 14:47:33 +00:00
artifacts:
when: always
reports:
junit: report.xml
only:
- testing
docker_build:
stage: build
script:
- docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD
- docker build -t friskygoat/rcgcdw:stable .
- docker push friskygoat/rcgcdw:stable
rules:
- if: $CI_RELEASE_DESCRIPTION