From 14e72704aa566ff4d9362bf3645f46014b6e5f09 Mon Sep 17 00:00:00 2001 From: Ivo Steinbrecher Date: Fri, 18 Jul 2025 13:11:30 +0200 Subject: [PATCH] Remove self hosted runners --- .github/workflows/code_checks.yml | 36 ++++++++++ ...ml => cubitpy_test_suite_with_secrets.yml} | 4 +- .github/workflows/testing.yml | 71 ------------------- 3 files changed, 38 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/code_checks.yml rename .github/workflows/{testing_with_secrets.yml => cubitpy_test_suite_with_secrets.yml} (95%) delete mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml new file mode 100644 index 0000000..f58bd30 --- /dev/null +++ b/.github/workflows/code_checks.yml @@ -0,0 +1,36 @@ +name: Code checks + +on: + schedule: + - cron: '0 04 * * *' + push: + branches: + - main + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + +jobs: + code_checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install cubitpy + run: | + python -m pip install --upgrade pip + pip install .[dev] + - name: Code checks + run: | + pre-commit install --install-hooks + if [ "${GITHUB_REF}" = "refs/heads/main" ]; then + SKIP=no-commit-to-branch pre-commit run --all-files + else + pre-commit run --all-files + fi diff --git a/.github/workflows/testing_with_secrets.yml b/.github/workflows/cubitpy_test_suite_with_secrets.yml similarity index 95% rename from .github/workflows/testing_with_secrets.yml rename to .github/workflows/cubitpy_test_suite_with_secrets.yml index 0af1ff4..919b072 100644 --- a/.github/workflows/testing_with_secrets.yml +++ b/.github/workflows/cubitpy_test_suite_with_secrets.yml @@ -1,4 +1,4 @@ -name: Protected test suite (can access cubit secrets) +name: Protected CubitPy test suite (can access cubit secrets) on: schedule: @@ -18,7 +18,7 @@ env: jobs: testing_coreform: - name: Test suite with Coreform + name: CubitPy tests with Coreform runs-on: ubuntu-latest environment: # Use the trusted environment only for PRs authored by an COLLABORATOR (no approval needed); all others use the untrusted environment (someone has to approve the workflow run). diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml deleted file mode 100644 index f246ac0..0000000 --- a/.github/workflows/testing.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Cubit testing - -on: - schedule: - - cron: '0 04 * * *' - push: - branches: - - main - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - code_checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - name: Install cubitpy - run: | - python -m pip install --upgrade pip - pip install .[dev] - - name: Code checks - run: | - pre-commit install --install-hooks - if [ "${GITHUB_REF}" = "refs/heads/main" ]; then - SKIP=no-commit-to-branch pre-commit run --all-files - else - pre-commit run --all-files - fi - testing_cubit15: - name: cubitpy-testing - runs-on: self-hosted - env: - CUBIT_ROOT: /imcs/public/compsim/opt/cubit-15.2 - PYTHON_VENV: python-testing-environment - SPACK_ACTIVATION_SCRIPT: /home_local/github-runner/testing_lib/spack/share/spack/setup-env.sh - TESTING_GITHUB: 1 - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Setup virtual environment and run tests - run: | - whoami - pwd - export CUBITPY_PATH="$(pwd)" - # Activate spack and load python - . ${SPACK_ACTIVATION_SCRIPT} - spack load python@3.12.1 - # Create the virtual environment - python -m venv $PYTHON_VENV - source $PYTHON_VENV/bin/activate - # Update pip - pip install --upgrade pip - # Install cubitpy - pip install -e .[dev] - # Print information on the python environment - python --version - pip list - # Run tests - pytest - # This tests that if cubit is completely closed everything works - cd tests - ./test_configurations.sh