Add operational experiments remote repository check before running (#… #886
This file contains hidden or 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
name: CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
# lint: # Turn on when linting issues are resolved | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 2 | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - name: Set up Python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: "3.9" | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# pip install -e .[all] | |
# - name: Lint code | |
# run: | | |
# ruff check . | |
test: | |
# needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: sudo apt-get install -y graphviz rsync curl | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip packaging setuptools twine | |
pip install --upgrade -e .[all] | |
- name: Unit tests | |
run: | | |
pytest \ | |
--cov=autosubmit --cov-config=.coveragerc \ | |
--cov-report=xml:test/coverage.xml --cov-append \ | |
test/unit | |
- name: Coverage report | |
run: | | |
coverage xml | |
coverage report | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_unit_py-${{ matrix.python-version }} | |
path: coverage.xml | |
retention-days: 7 | |
test-integration: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: sudo apt-get install -y graphviz rsync curl | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip packaging setuptools twine | |
pip install --upgrade -e .[all] | |
# In GitHub Actions we run all the integration tests, including those that require | |
# dependencies such as Docker (see `-m ''`, which means all markers). Read the | |
# CONTRIBUTING.md file for details how to set up your environment to run these. | |
- name: Integration tests | |
run: | | |
pytest \ | |
--cov=autosubmit --cov-config=.coveragerc \ | |
--cov-report=xml:test/coverage.xml --cov-append \ | |
test/integration \ | |
-m '' | |
# Run regression tests | |
- name: Regression tests | |
run: | | |
pytest \ | |
--cov=autosubmit --cov-config=.coveragerc \ | |
--cov-report=xml:test/coverage.xml --cov-append \ | |
test/regression \ | |
-m '' | |
- name: Coverage report | |
run: | | |
coverage xml | |
coverage report | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_integration_py-${{ matrix.python-version }} | |
path: coverage.xml | |
retention-days: 7 | |
test-regression: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: sudo apt-get install -y graphviz rsync curl | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip packaging setuptools twine | |
pip install --upgrade -e .[all] | |
# Run regression tests | |
- name: Regression tests | |
run: | | |
pytest \ | |
--cov=autosubmit --cov-config=.coveragerc \ | |
--cov-report=xml:test/coverage.xml --cov-append \ | |
test/regression \ | |
-m '' | |
- name: Coverage report | |
run: | | |
coverage xml | |
coverage report | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_regression_py-${{ matrix.python-version }} | |
path: coverage.xml | |
retention-days: 7 | |
coverage: | |
needs: [test, test-integration, test-regression] | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download coverage artifacts | |
uses: actions/download-artifact@v4 | |
- name: Codecov upload | |
uses: codecov/codecov-action@v5 | |
with: | |
name: ${{ github.workflow }} | |
flags: fast-tests | |
fail_ci_if_error: true | |
verbose: true | |
# Token not required for public repos, but avoids upload failure due | |
# to rate-limiting (but not for PRs opened from forks) | |
token: ${{ secrets.CODECOV_TOKEN }} |