Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] backport github actions to stable branch (3.5.x) #1317

Merged
merged 17 commits into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
23 changes: 0 additions & 23 deletions .github/workflows/asv.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: cibuildwheel

on:
push:
branches: [stable]
tags: v*
pull_request:
branches: [stable]
schedule:
- cron: "0 0 * * *" # daily

jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [
linux-x86_64,
linux-aarch64,
linux-ppc64le,
linux-s390x,
macos-x86_64,
]
include:
- build: linux-x86_64
os: ubuntu-18.04
arch: x86_64
macos_target: ''
- build: linux-aarch64
os: ubuntu-18.04
arch: aarch64
macos_target: ''
- build: linux-ppc64le
os: ubuntu-18.04
arch: ppc64le
macos_target: ''
- build: linux-s390x
os: ubuntu-18.04
arch: s390x
macos_target: ''
- build: macos-x86_64
os: macos-latest
arch: x86_64
macos_target: 'MACOSX_DEPLOYMENT_TARGET=10.11'
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.8.0

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
env:
CIBW_BUILD: "cp39-*"
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_BEFORE_BUILD: 'source .ci/install_cargo.sh'
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_MACOS: ${{ matrix.macos_target }}
CIBW_BUILD_VERBOSITY: 3
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
run: |
python -m cibuildwheel --output-dir dist
ls -lR ./dist

- uses: actions/upload-artifact@v2
with:
path: './dist/sourmash*.whl'

release:
name: Publish wheels
runs-on: ubuntu-18.04
if: startsWith(github.ref, 'refs/tags/v')
needs: build_wheels

steps:
- name: Fetch wheels from artifacts
id: fetch_artifacts
uses: actions/download-artifact@v2
with:
path: 'wheels/'

# if it matches a Python release tag, upload to github releases
# TODO: In the future, use the create-release and upload-release-assets actions
- name: Release
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: ${{steps.fetch_artifacts.outputs.download-path}}/artifact
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 6 additions & 12 deletions .github/workflows/hypothesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Hypothesis tests

on:
push:
branches: [master]
branches: [latest]
pull_request:
branches: [master]
branches: [latest]
schedule:
- cron: "0 0 * * *" # daily

jobs:
test:
Expand All @@ -20,15 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
pip install tox

- name: Run Hypothesis tests
run: |
python -m pytest --cov=. --cov-report=xml --run-hypothesis --hypothesis-show-statistics --hypothesis-profile ci

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
run: tox -e hypothesis,coverage
25 changes: 8 additions & 17 deletions .github/workflows/khmer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: khmer compatibility tests

on:
push:
branches: [master]
branches: [latest]
pull_request:
branches: [master]
branches: [latest]
schedule:
- cron: "0 0 * * *" # daily

jobs:
test:
Expand All @@ -20,21 +22,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
pip install tox

- name: Run tests with latest released khmer
run: |
python -m pip install khmer
python -m pytest -k test_nodegraph --cov=. --cov-report=xml

- name: Run tests with khmer master tests
run: |
python -m pip install -U git+https://github.com/dib-lab/khmer.git#egg=khmer
python -m pytest -k test_nodegraph --cov=. --cov-report=xml
run: tox -e khmer,coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
- name: Run tests with khmer master branch
run: tox -e khmer_master,coverage
6 changes: 4 additions & 2 deletions .github/workflows/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Metadata checks

on:
push:
branches: [master]
branches: [latest]
pull_request:
branches: [master]
branches: [latest]
schedule:
- cron: "0 0 * * *" # daily

jobs:
archive:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Python tests

on:
push:
branches: [stable]
pull_request:
branches: [stable]
schedule:
- cron: "0 0 * * *" # daily

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
py: [3.9, 3.8, 3.7]
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions

- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v1

- name: Set up IPFS
if: startsWith(runner.os, 'Linux') && (matrix.py == '3.9')
uses: ibnesayeed/setup-ipfs@master
with:
ipfs_version: 0.6
run_daemon: true

- name: Start Redis
if: startsWith(runner.os, 'Linux') && (matrix.py == '3.9')
uses: supercharge/redis-github-action@4687e0c1d27b144de1dadc32967b7ce7e1227c7f
with:
redis-version: 6

- name: tox cache
uses: actions/cache@v2
with:
path: .tox/
key: ${{ runner.os }}-tox-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-tox-

- name: Test with tox
run: tox -e py
env:
PYTHONDEVMODE: 1
16 changes: 9 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: Rust checks

on:
push:
branches: [master]
branches: [latest]
pull_request:
paths:
- 'src/core/**'
- 'tests/test-data/**'
schedule:
- cron: "0 0 * * *" # daily

jobs:
check:
Expand Down Expand Up @@ -125,10 +128,9 @@ jobs:
run: cargo tarpaulin --all --all-features --timeout 600 --out Xml -- --test-threads 1

- name: Upload Rust coverage to codecov
uses: codecov/codecov-action@797e92895ec0eac368405352c0add9af878fe257
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rusttests
flags: rust
fail_ci_if_error: true

lints:
Expand Down Expand Up @@ -162,7 +164,7 @@ jobs:
name: Check if wasm-pack builds a valid package for the sourmash crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -190,7 +192,7 @@ jobs:
name: Run tests under wasm32-wasi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Install wasm32-wasi target
uses: actions-rs/toolchain@v1
with:
Expand All @@ -199,7 +201,7 @@ jobs:
- name: Install wasmtime
run: "curl https://wasmtime.dev/install.sh -sSf | bash"
- name: Add wasmtime to PATH
run: echo "::add-path::$HOME/.wasmtime/bin"
run: echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
- name: Install cargo-wasi command
uses: actions-rs/cargo@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check if wasm-pack builds a valid package for the sourmash crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
Loading