From 42650815034345ca8fdff30c0defc961cc8224c8 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 6 Jan 2025 12:08:14 +0100 Subject: [PATCH] Run install tests from lockfile --- .github/actions/install-aiida-core/action.yml | 5 ++++- .github/workflows/test-install.yml | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-aiida-core/action.yml b/.github/actions/install-aiida-core/action.yml index 26e6cac96..ad5285ad2 100644 --- a/.github/actions/install-aiida-core/action.yml +++ b/.github/actions/install-aiida-core/action.yml @@ -10,6 +10,7 @@ inputs: description: list of optional dependencies # NOTE: The default 'pre-commit' extra recursively contains # other extras needed to run the tests. + # NOTE: When using a lockfile, set to 'all' to use all extras default: pre-commit required: false # NOTE: Hard-learned lesson: we cannot use type=boolean here, apparently :-( @@ -39,8 +40,10 @@ runs: - name: Install dependencies from uv lock if: ${{ inputs.from-lock == 'true' }} # NOTE: We're asserting that the lockfile is up to date - run: uv sync --locked ${{ inputs.extras && format('--extra {0}', inputs.extras) || '' }} + run: uv sync --locked ${{ env.EXTRAS }} shell: bash + env: + EXTRAS: ${{ inputs.extras == 'all' && '--all-extras' }} ${{ inputs.extras && inputs.extras != 'all' && format('--extra {0}', inputs.extras) || '' }} - name: Install aiida-core if: ${{ inputs.from-lock != 'true' }} diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 15e68fc2d..4cf8fa0f9 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -11,6 +11,9 @@ on: schedule: - cron: 30 02 * * * # nightly build +env: + FORCE_COLOR: 1 + # https://docs.github.com/en/actions/using-jobs/using-concurrency concurrency: # only cancel in-progress jobs or runs for the current workflow - matches against branch & tags @@ -29,10 +32,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' - name: Set up uv uses: astral-sh/setup-uv@v5 @@ -198,8 +201,8 @@ jobs: uses: ./.github/actions/install-aiida-core with: python-version: ${{ matrix.python-version }} - extras: '[atomic_tools,docs,notebook,rest,tests,tui]' - from-lock: 'false' + extras: all + from-lock: 'true' - name: Setup AiiDA environment run: .github/workflows/setup.sh