diff options
Diffstat (limited to '.github/workflows/ci.yml')
| -rw-r--r-- | .github/workflows/ci.yml | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..24f06e1 --- /dev/null +++ b/.github/workflows/ci.yml | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | name: CI | ||
| 2 | |||
| 3 | on: | ||
| 4 | release: | ||
| 5 | types: [created] | ||
| 6 | push: | ||
| 7 | schedule: | ||
| 8 | # Runs every Thursday at 20:23 GMT to avoid bit rot | ||
| 9 | - cron: "20 23 * * 4" | ||
| 10 | |||
| 11 | jobs: | ||
| 12 | lint: | ||
| 13 | runs-on: ubuntu-latest | ||
| 14 | steps: | ||
| 15 | - name: Checkout | ||
| 16 | uses: actions/checkout@v1 | ||
| 17 | |||
| 18 | - name: Install latest nightly | ||
| 19 | uses: actions-rs/toolchain@v1 | ||
| 20 | with: | ||
| 21 | toolchain: nightly | ||
| 22 | override: true | ||
| 23 | |||
| 24 | - name: Lint with rustfmt | ||
| 25 | uses: actions-rs/cargo@v1 | ||
| 26 | with: | ||
| 27 | command: fmt | ||
| 28 | |||
| 29 | - name: Lint with clippy | ||
| 30 | uses: actions-rs/cargo@v1 | ||
| 31 | with: | ||
| 32 | command: clippy | ||
| 33 | args: --all-targets --all-features | ||
| 34 | |||
| 35 | build: | ||
| 36 | runs-on: ${{ matrix.os }} | ||
| 37 | needs: lint | ||
| 38 | strategy: | ||
| 39 | fail-fast: false | ||
| 40 | matrix: | ||
| 41 | python-version: [3.5, 3.6, 3.7, 3.8] | ||
| 42 | os: [ubuntu-latest, macos-latest, windows-latest] | ||
| 43 | exclude: | ||
| 44 | # There is a known issue where Python C extensions | ||
| 45 | # can not be built on Python 3.5 on Windows. | ||
| 46 | # https://github.com/actions/virtual-environments/issues/34 | ||
| 47 | # Therefore, ujson can't be compiled and the build would fail. | ||
| 48 | - os: windows-latest | ||
| 49 | python-version: 3.5 | ||
| 50 | |||
| 51 | steps: | ||
| 52 | - name: Checkout | ||
| 53 | uses: actions/checkout@v1 | ||
| 54 | |||
| 55 | - name: Set up Python ${{ matrix.python-version }} | ||
| 56 | uses: actions/setup-python@v1 | ||
| 57 | with: | ||
| 58 | python-version: ${{ matrix.python-version }} | ||
| 59 | |||
| 60 | - name: Install dependencies | ||
| 61 | run: | | ||
| 62 | python -m pip install --upgrade pip | ||
| 63 | pip install poetry | ||
| 64 | poetry install | ||
| 65 | - name: Install latest nightly | ||
| 66 | uses: actions-rs/toolchain@v1 | ||
| 67 | with: | ||
| 68 | toolchain: nightly | ||
| 69 | override: true | ||
| 70 | |||
| 71 | - name: Build Python package | ||
| 72 | run: poetry run maturin develop --release \ No newline at end of file | ||
