mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-12 05:26:45 +00:00
👷 Add GitHub Actions, move from Travis (#1735)
This commit is contained in:
parent
10ae6de111
commit
47a630721a
5 changed files with 66 additions and 29 deletions
29
.github/workflows/publish.yml
vendored
Normal file
29
.github/workflows/publish.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: "3.6"
|
||||||
|
- name: Install Flit
|
||||||
|
run: pip install flit
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: flit install --symlink
|
||||||
|
- name: Publish
|
||||||
|
env:
|
||||||
|
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
|
||||||
|
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
|
||||||
|
run: bash scripts/publish.sh
|
||||||
|
- name: Notify
|
||||||
|
env:
|
||||||
|
GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }}
|
||||||
|
run: bash scripts/notify.sh
|
||||||
29
.github/workflows/test.yml
vendored
Normal file
29
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.6, 3.7, 3.8]
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install Flit
|
||||||
|
run: pip install flit
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: flit install --symlink
|
||||||
|
- name: Test
|
||||||
|
run: bash scripts/test.sh
|
||||||
|
- name: Upload coverage
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
16
.travis.yml
16
.travis.yml
|
|
@ -21,12 +21,12 @@ install:
|
||||||
script:
|
script:
|
||||||
- bash scripts/test.sh
|
- bash scripts/test.sh
|
||||||
|
|
||||||
after_script:
|
# after_script:
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
# - bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
||||||
deploy:
|
# deploy:
|
||||||
provider: script
|
# provider: script
|
||||||
script: bash scripts/deploy.sh
|
# script: bash scripts/deploy.sh
|
||||||
on:
|
# on:
|
||||||
tags: true
|
# tags: true
|
||||||
python: "3.6"
|
# python: "3.6"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,4 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
bash scripts/publish.sh
|
|
||||||
|
|
||||||
bash scripts/trigger-docker.sh
|
|
||||||
|
|
||||||
python scripts/gitter_releases_bot.py
|
python scripts/gitter_releases_bot.py
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
body='{
|
|
||||||
"request": {
|
|
||||||
"branch":"master"
|
|
||||||
}}'
|
|
||||||
|
|
||||||
curl -s -X POST \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "Accept: application/json" \
|
|
||||||
-H "Travis-API-Version: 3" \
|
|
||||||
-H "Authorization: token $TRAVIS_TOKEN" \
|
|
||||||
-d "$body" \
|
|
||||||
https://api.travis-ci.org/repo/tiangolo%2Fuvicorn-gunicorn-fastapi-docker/requests
|
|
||||||
Loading…
Reference in a new issue