diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..b1314bc4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: Deploy + +on: + push: + branches: [main] + tags: ['*'] + +env: + JAVA_VERSION: 11 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: 'adopt' + - name: Release to Maven Central + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + run: sbt ci-release + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies for PyPI release + run: | + sudo apt-get install -y pandoc + cd python + make + pip install --only-binary=numpy,scipy -r requirements.txt + - name: Build and publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + cd python + python setup.py sdist bdist_wheel + pip install twine + twine upload dist/* + if: startsWith(github.ref, 'refs/tags/') \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..d766f382 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,65 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + SCALA_VERSION: 2.13.8 + JAVA_VERSION: 11 + +jobs: + test-scala: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: 'adopt' + - name: Cache SBT dependencies + uses: actions/cache@v2 + with: + path: | + ~/.ivy2/cache + ~/.sbt + ~/.m2 + key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} + - name: Run Scala tests + run: | + sbt -Dsbt.log.noformat=true scalafmtCheckAll + sbt -Dsbt.log.noformat=true +test + + test-python: + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.8"] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Cache pip dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + cd python + make + pip install --only-binary=numpy,scipy -r requirements.txt + pip install -r test_requirements.txt + - name: Run Python tests + run: | + cd python + nosetests \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c4194ee9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,79 +0,0 @@ -language: scala -scala: 2.13.8 -jdk: openjdk11 -dist: bionic - -cache: - directories: - - "~/.m2/repository" - - "~/.cache/pip" - - $HOME/.ivy2/cache - -before_cache: - # Cleanup the cached directories to avoid unnecessary cache updates - - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete - -before_install: - - git fetch --tags - -stages: - - name: test - - name: release - if: ((branch = main AND type = push) OR (tag IS present)) AND NOT fork - -jobs: - include: - - stage: test - script: - - sbt -Dsbt.log.noformat=true scalafmtCheckAll - - sbt -Dsbt.log.noformat=true +test - - stage: test - before_install: - - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda3/bin:$PATH - - conda update --yes conda - - conda create --yes -n condaenv python=3.8 - - conda install --yes -n condaenv pip - - source activate condaenv - install: - - cd python - - make - - pip install --only-binary=numpy,scipy -r requirements.txt - - pip install -r test_requirements.txt - script: - - nosetests - - stage: release - name: maven central - script: sbt ci-release - - stage: release - name: pypi - addons: - apt: - packages: - - pandoc - before_install: - - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda3/bin:$PATH - - conda update --yes conda - - conda create --yes -n condaenv python=3.8 - - conda install --yes -n condaenv pip - - source activate condaenv - install: - - cd python - - make - - pip install --only-binary=numpy,scipy -r requirements.txt - script: true - deploy: - provider: pypi - skip_cleanup: true - skip_existing: true - user: CitrineInformatics - password: - secure: fb/NiAH7E1zA2iRUT+NMywH7dh0HF3qLM/JhjWLQWQ8l/pxOy7HPgk1CDEkZip/4emH2ur5+bGAD0pm0ewfDWfvjTPA+woV5IEebK2KL3Gm4Oam4fZP27NZ5zfYs6Q1dx3YPjRUgI3gtJ+0Y1tVKvZrUaZHityDMJDuEsYjdmPnFsA6s6U/5GYeQfWaYjZcflqYd01H8K9kbCeBsRBlOUm1lCXmt13R4uBOoMNAkuR7knYUOE1VM6VJWTN2T0iKphS9agxPHh/9/B9gjCQExhynOWSs5E2WhhDnWUoAJgyaZdxZQOxT2jJKA4dJGMCtyQScWItjsglcpthd+DsNtx/0vF1fDV3tvdjRVfegnhcF9fMUeI30O5jGTqNhimkiQsV1L+Sn6LFVAJKZ2yGzjqyS+8wn/uGOLQ04R46aw7KcfDJthzPU+dx0W78scTnkOnOx0R6eLH/HBn619h415JSsYpQ/D4A2VzODhHfScgzEe9xoL61ArhYz/wAqEAvit8WbFs4D7ZVnBc/98wsBD2NKUlmTZfkjPDAZQr49S1Na6UKlK6p4gLkXE6hfwgkFwxLiaQxOMfg0u/7VbbJzfrB2568HerS/oilDq+Bp+jNKUwyo08P0qD+8a4Gif1uk1UcipixDWbCvNlfr1H7+2FrN0+b92Xmfjd+CTMKmfv7o= - distributions: sdist bdist_wheel - on: - tags: true