diff --git a/.github/actions/setup-pixi/action.yml b/.github/actions/setup-pixi/action.yml new file mode 100644 index 00000000..8c68f51e --- /dev/null +++ b/.github/actions/setup-pixi/action.yml @@ -0,0 +1,34 @@ +name: 'Setup Pixi Environment' +description: 'Sets up pixi with common configuration' +inputs: + environments: + description: 'Pixi environments to setup' + required: false + default: 'dev' + activate-environment: + description: 'Environment to activate' + required: false + default: 'dev' + run-install: + description: 'Whether to run install' + required: false + default: 'true' + cache: + description: 'Whether to use cache' + required: false + default: 'false' + post-cleanup: + description: 'Whether to run post cleanup' + required: false + default: 'false' + +runs: + using: 'composite' + steps: + - uses: prefix-dev/setup-pixi@v0.9.0 + with: + environments: ${{ inputs.environments }} + activate-environment: ${{ inputs.activate-environment }} + run-install: ${{ inputs.run-install }} + cache: ${{ inputs.cache }} + post-cleanup: ${{ inputs.post-cleanup }} \ No newline at end of file diff --git a/.github/workflows/documentation-build.yml b/.github/workflows/documentation-build.yml index 736d5eef..73b2e52b 100644 --- a/.github/workflows/documentation-build.yml +++ b/.github/workflows/documentation-build.yml @@ -27,13 +27,8 @@ jobs: with: fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - - uses: prefix-dev/setup-pixi@v0.9.0 - with: - environments: dev - activate-environment: dev - run-install: true - cache: false - post-cleanup: false + - name: Setup Pixi + uses: ./.github/actions/setup-pixi - name: Build documentation run: pixi run docs-build diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 48e35e1f..cf957e00 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -19,14 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: prefix-dev/setup-pixi@v0.9.0 - with: - environments: dev - activate-environment: dev - run-install: true - cache: false - post-cleanup: false - + - name: Setup Pixi + uses: ./.github/actions/setup-pixi - name: Run linting run: pixi run lint - name: Suggestion to fix issues @@ -48,11 +42,10 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: prefix-dev/setup-pixi@v0.9.0 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.9.0 with: - environments: dev - activate-environment: dev - run-install: true + run-install: false cache: false post-cleanup: false @@ -60,7 +53,7 @@ jobs: run: pixi add python=${{ matrix.python-version }} - name: Install dependencies and run tests - run: pixi run test + run: pixi run -e dev test - name: Upload coverage uses: codecov/codecov-action@v4.0.1 @@ -80,13 +73,8 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: prefix-dev/setup-pixi@v0.9.0 - with: - environments: dev - activate-environment: dev - run-install: true - cache: false - post-cleanup: false + - name: Setup Pixi + uses: ./.github/actions/setup-pixi - name: Build package run: pixi run build diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0afd443d..2187d301 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,13 +26,8 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: prefix-dev/setup-pixi@v0.9.0 - with: - environments: dev - activate-environment: dev - run-install: true - cache: false - post-cleanup: false + - name: Setup Pixi + uses: ./.github/actions/setup-pixi - name: Build package run: pixi run build