Skip to content

CI

CI #115

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '23 5 * * 2' # weekly run to check things are still working
env:
PYTHON_VERSION: 3.11
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install poetry
run: pip install poetry
- name: Determine dependencies
run: poetry lock
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Install Dependencies using Poetry
run: poetry install --extras dev
- name: Check code
run: poetry run pre-commit run --all
testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: 'rucio/rucio'
ref: '37.5.0'
path: '.rucio'
- name: Expose Rucio and XrootD service
run: |
cd "$GITHUB_WORKSPACE/.rucio"
git apply "$GITHUB_WORKSPACE/ci/rucio/expose_ports.patch"
echo "127.0.0.1 xrd1" | sudo tee -a /etc/hosts
- name: Run docker compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "${{ github.workspace }}/.rucio/etc/docker/dev/docker-compose.yml"
compose-flags: "--profile storage"
- name: Configure Rucio and populate with test data.
run: docker exec dev-rucio-1 /opt/rucio/tools/run_tests.sh -ir
- name: Copy certificates
run: |
sudo mkdir /etc/grid-security
sudo docker cp dev-rucio-1:/etc/grid-security/certificates /etc/grid-security
docker cp dev-rucio-1:/tmp/x509up_u0 /tmp
- name: Install XrootD client
run: |
sudo apt-get update
sudo apt-get install xrootd-client
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install poetry
run: pip install poetry
- name: Determine dependencies
run: poetry lock
- name: Install dependencies
run: poetry install --extras dev
- name: Check Rucio service availability
run: |
set -x
poetry run rucio --verbose ping
poetry run rucio whoami
poetry run rucio did list test:* --filter type=file
poetry run rucio replica list file test:file1
env:
RUCIO_CONFIG: "ci/rucio/rucio.cfg"
X509_CERT_DIR: "/etc/grid-security/certificates"
X509_USER_PROXY: "/tmp/x509up_u0"
- name: Run tests
run: >-
poetry run pytest
--log-level debug
--cov
--cov-branch
--cov-report=xml
--junitxml=junit.xml
-o junit_family=legacy
env:
RUCIO_CONFIG: "ci/rucio/rucio.cfg"
X509_CERT_DIR: "/etc/grid-security/certificates"
X509_USER_PROXY: "/tmp/x509up_u0"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}