-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate testing from building in github actions and adding a keepali…
…ve workflow (#111) Co-authored-by: Jaquier Aurélien Tristan <aurelien.jaquier@epfl.ch>
- Loading branch information
1 parent
93fd036
commit 2c08dac
Showing
4 changed files
with
98 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
call-test-workflow: | ||
uses: BlueBrain/BluePyEfe/.github/workflows/test.yml@master | ||
|
||
build-n-publish: | ||
name: Build and publish on PyPI | ||
runs-on: ubuntu-latest | ||
needs: call-test-workflow | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.6 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
- name: Build a source tarball and wheel | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Keep-alive | ||
|
||
on: | ||
schedule: | ||
# Runs every sunday at 3 a.m. | ||
- cron: '0 3 * * SUN' | ||
|
||
jobs: | ||
call-test-workflow: | ||
uses: BlueBrain/BluePyEfe/.github/workflows/test.yml@master | ||
|
||
keep-workflow-alive: | ||
name: Keep workflow alive | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
- name: Get date from 50 days ago | ||
run: | | ||
datethen=`date -d "-50 days" --utc +%FT%TZ` | ||
echo "datelimit=$datethen" >> $GITHUB_ENV | ||
- name: setup git config | ||
if: github.event.base.repo.updated_at <= env.datelimit | ||
run: | | ||
# setup the username and email. | ||
git config user.name "Github Actions Keepalive Bot" | ||
git config user.email "<>" | ||
- name: commit IF last commit is older than 50 days | ||
if: github.event.base.repo.updated_at <= env.datelimit | ||
run: | | ||
git commit -m "Empty commit to keep the gihub workflows alive" --allow-empty | ||
git push origin master |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
# allows this workflow to be reusable (e.g. by the build workflow) | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
pip install tox tox-gh-actions | ||
- name: Run tox | ||
run: tox | ||
- name: "Upload coverage to Codecov" | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: false |