diff --git a/.github/actions/install-examples/action.yml b/.github/actions/install-examples/action.yml deleted file mode 100644 index 0289411e..00000000 --- a/.github/actions/install-examples/action.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: install-examples - -inputs: - python-version: - description: Python version - required: false - default: '3.11' - type: string - -runs: - using: composite - steps: - - name: Install Concordia - id: install-concordia - uses: ./.github/actions/install-concordia - with: - python-version: ${{ inputs.python-version }} - - - name: Restore Examples installation - id: restore - uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: venv - key: install-examples-${{ steps.install-concordia.outputs.key }}-${{ hashFiles('examples/requirements.txt') }} - - - name: Activate venv - shell: bash - run: | - echo "${PWD}/venv/bin" >> $GITHUB_PATH - - - name: Install requirements for examples - if: steps.restore.outputs.cache-hit != 'true' - shell: bash - run: | - pip install -r examples/requirements.txt - - - name: Show installation - shell: bash - run: | - which python - python --version - which pip - pip --version - which pylint - pylint --version - which pytest - pytest --version - which pytype - pytype --version - pip list - - - name: Save Examples installation - if: steps.restore.outputs.cache-hit != 'true' - uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: venv - key: ${{ steps.restore.outputs.cache-primary-key }} diff --git a/.github/actions/install-concordia/action.yml b/.github/actions/install/action.yml similarity index 82% rename from .github/actions/install-concordia/action.yml rename to .github/actions/install/action.yml index 229b1414..2f745596 100644 --- a/.github/actions/install-concordia/action.yml +++ b/.github/actions/install/action.yml @@ -1,4 +1,4 @@ -name: install-concordia +name: install inputs: python-version: @@ -34,14 +34,14 @@ runs: else exit 1 fi - echo "key=${name}-${version}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('setup.py') }}" >> $GITHUB_OUTPUT + echo "key=${name}-${version}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}" >> $GITHUB_OUTPUT - - name: Restore Concordia installation + - name: Restore installation id: restore uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: venv - key: install-concordia-${{ steps.cache-key.outputs.key }} + key: install-${{ steps.cache-key.outputs.key }} - name: Create venv if: steps.restore.outputs.cache-hit != 'true' @@ -54,11 +54,12 @@ runs: run: | echo "${PWD}/venv/bin" >> $GITHUB_PATH - - name: Install Concordia + - name: Install if: steps.restore.outputs.cache-hit != 'true' shell: bash run: | - pip install --editable .[dev] + pip install --require-virtualenv --require-hashes -r requirements.txt + pip install --require-virtualenv --no-deps --no-index --no-build-isolation --editable . - name: Show installation shell: bash @@ -75,7 +76,7 @@ runs: pytype --version pip list - - name: Save Concordia installation + - name: Save installation if: steps.restore.outputs.cache-hit != 'true' uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: diff --git a/.github/workflows/test-concordia.yml b/.github/workflows/test-concordia.yml index 2b35030f..9c59bbcb 100644 --- a/.github/workflows/test-concordia.yml +++ b/.github/workflows/test-concordia.yml @@ -5,21 +5,23 @@ on: branches: - main paths: - - '.github/actions/install-concordia/action.yml' + - '.github/actions/install/action.yml' - '.github/workflows/test-concordia.yml' - '.pylintrc' - 'concordia/**' - 'pyproject.toml' + - 'requirements.txt' - 'setup.py' pull_request: branches: - main paths: - - '.github/actions/install-concordia/action.yml' + - '.github/actions/install/action.yml' - '.github/workflows/test-concordia.yml' - '.pylintrc' - 'concordia/**' - 'pyproject.toml' + - 'requirements.txt' - 'setup.py' workflow_dispatch: @@ -38,7 +40,7 @@ jobs: uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - name: Install Concordia - uses: ./.github/actions/install-concordia + uses: ./.github/actions/install - name: Test Concordia run: pytest concordia diff --git a/.github/workflows/test-examples.yml b/.github/workflows/test-examples.yml index 02c43005..58ec4757 100644 --- a/.github/workflows/test-examples.yml +++ b/.github/workflows/test-examples.yml @@ -5,25 +5,25 @@ on: branches: - main paths: - - '.github/actions/install-examples/action.yml' - - '.github/actions/install-concordia/action.yml' + - '.github/actions/install/action.yml' - '.github/workflows/test-examples.yml' - '.pylintrc' - 'concordia/**' - 'examples/**' - 'pyproject.toml' + - 'requirements.txt' - 'setup.py' pull_request: branches: - main paths: - - '.github/actions/install-examples.yml' - - '.github/actions/install-concordia.yml' + - '.github/actions/install/action.yml' - '.github/workflows/test-examples.yml' - '.pylintrc' - 'concordia/**' - 'examples/**' - 'pyproject.toml' + - 'requirements.txt' - 'setup.py' workflow_dispatch: @@ -42,8 +42,8 @@ jobs: - name: Checkout Concordia uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - - name: Install examples - uses: ./.github/actions/install-examples + - name: Install Concordia + uses: ./.github/actions/install - name: Test examples run: pytest examples