diff --git a/.github/workflows/ci.yml b/.github/workflows/pr.yml similarity index 89% rename from .github/workflows/ci.yml rename to .github/workflows/pr.yml index a5e2c254..57fda235 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/pr.yml @@ -1,6 +1,13 @@ -name: ci +name: pr -on: [push, pull_request] +on: + push: + branches: [develop, main] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true env: X_PYTHON_MIN_VERSION: "3.10" @@ -19,6 +26,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MIN_VERSION }} + cache: "pip" + cache-dependency-path: "./check_python_versions_requirements.txt" - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -53,7 +62,7 @@ jobs: # that you want to use to test the serialization adapter against. # Currently, we need to update this manually, however I'm afraid this is not possible to automatically infer, # since it's heavily dependant of the version of the AAS specification we support. - AAS_SPECS_RELEASE_TAG: "IDTA-01001-3-1-2" + AAS_SPECS_RELEASE_TAG: "v3.1.2" services: couchdb: image: couchdb:3 @@ -77,11 +86,13 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Collect schema files from aas-specs run: | mkdir -p ./test/adapter/schema - curl -sSL -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json - curl -sSL -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd + curl -sSLf -o ./test/adapter/schema/aasJSONSchema.json https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/json/aas.json + curl -sSLf -o ./test/adapter/schema/aasXMLSchema.xsd https://raw.githubusercontent.com/admin-shell-io/aas-specs-metamodel/refs/tags/${{ env.AAS_SPECS_RELEASE_TAG }}/schemas/xml/AAS.xsd - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -109,6 +120,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MIN_VERSION }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -132,6 +145,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MIN_VERSION }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -159,6 +174,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MAX_VERSION }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -215,17 +232,14 @@ jobs: steps: - uses: actions/checkout@v4 - with: - # TODO(#592): revisit when the sdk<->compliance_tool version pinning is fixed. - # Need tags so setuptools_scm builds the local sdk as >=1.0.0, else the loose - # `basyx-python-sdk>=1.0.0` pin lets pip replace it with the PyPI release. - fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies - # install the local sdk first so its version satisfies the >=1.0.0 pin and pip keeps it instead of PyPI + # install the local sdk in editable mode so it does not get overwritten run: | python -m pip install --upgrade pip python -m pip install ../sdk @@ -247,17 +261,14 @@ jobs: working-directory: ./compliance_tool steps: - uses: actions/checkout@v4 - with: - # TODO(#592): revisit when the sdk<->compliance_tool version pinning is fixed. - # Need tags so setuptools_scm builds the local sdk as >=1.0.0, else the loose - # `basyx-python-sdk>=1.0.0` pin lets pip replace it with the PyPI release. - fetch-depth: 0 - name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }} uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MIN_VERSION }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies - # install the local sdk first so its version satisfies the >=1.0.0 pin and pip keeps it instead of PyPI + # install the local sdk in editable mode so it does not get overwritten run: | python -m pip install --upgrade pip python -m pip install ../sdk @@ -308,6 +319,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.X_PYTHON_MIN_VERSION }} + cache: "pip" + cache-dependency-path: "**/pyproject.toml" - name: Install Python dependencies run: | python -m pip install --upgrade pip