]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
👷 Add GitHub Actions, move from Travis (#1735)
authorSebastián Ramírez <tiangolo@gmail.com>
Sun, 19 Jul 2020 12:03:38 +0000 (14:03 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2020 12:03:38 +0000 (14:03 +0200)
.github/workflows/publish.yml [new file with mode: 0644]
.github/workflows/test.yml [new file with mode: 0644]
.travis.yml
scripts/notify.sh [moved from scripts/deploy.sh with 54% similarity]
scripts/trigger-docker.sh [deleted file]

diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644 (file)
index 0000000..e25bf19
--- /dev/null
@@ -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
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..ef3c6f0
--- /dev/null
@@ -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
index 5bc279c31ca4388ce05afd3a416f99c57dbe6ad3..4a01c3e7f8ad50b674b6156891cfff6fa998aad5 100644 (file)
@@ -21,12 +21,12 @@ install:
 script:
     - bash scripts/test.sh
 
-after_script:
-    - bash <(curl -s https://codecov.io/bash)
-
-deploy:
-    provider: script
-    script: bash scripts/deploy.sh
-    on:
-        tags: true
-        python: "3.6"
+after_script:
+    - bash <(curl -s https://codecov.io/bash)
+
+deploy:
+    provider: script
+    script: bash scripts/deploy.sh
+    on:
+        tags: true
+        python: "3.6"
similarity index 54%
rename from scripts/deploy.sh
rename to scripts/notify.sh
index 3ed050af3b84f9737ceae7f21c2d630cb0492569..8ce550026abdcd0f794f4a3d58bf4e8214df0166 100755 (executable)
@@ -2,8 +2,4 @@
 
 set -e
 
-bash scripts/publish.sh
-
-bash scripts/trigger-docker.sh
-
 python scripts/gitter_releases_bot.py
diff --git a/scripts/trigger-docker.sh b/scripts/trigger-docker.sh
deleted file mode 100755 (executable)
index 660b1a1..0000000
+++ /dev/null
@@ -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