Skip to content

DevOps: add a weekly build and test #81

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
73 changes: 73 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: weekly

on:
schedule:
- cron: '0 0 * * 0' # Run every week on Sunday
push:
paths:
- '.github/workflows/weekly.yml'
pull_request:
paths:
- '.github/workflows/weekly.yml'


jobs:

tests:

if: github.repository == 'bastonero/aiida-vibroscopy' # Prevent running the builds on forks as well
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.12']

services:
postgres:
image: postgres:12
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672

steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-${{ matrix.python-version }}-tests

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

- name: Install Python dependencies
id: install
run: |
pip install -e .[tests]
pip install git+https://github.com/aiidateam/aiida-core@main#egg=aiida-core[atomic_tools]
pip install git+https://github.com/aiidateam/aiida-quantumespresso.git@main
pip install git+https://github.com/phonopy/phonopy.git@develop

- name: Run pytest
id: tests
env:
AIIDA_WARN_v3: 1
run: pytest -sv tests

# - name: Slack notification
# if: always() && (steps.install.outcome == 'Failure' || steps.tests.outcome == 'Failure')
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_ICON: https://www.materialscloud.org/discover/images/0ba0a17d.aiida-logo-128.png
# SLACK_USERNAME: aiida-quantumespresso
# SLACK_CHANNEL: dev-aiida-qe
# SLACK_COLOR: b60205
# SLACK_TITLE: "Nightly build against `aiida-core/main` failed"
# SLACK_MESSAGE: "The tests fail with the current version of `aiida-core/main`."
Loading