diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 55eb1aa..6a5d182 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,6 @@ name: Build docs +permissions: + contents: read on: @@ -18,12 +20,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: "3.10" - - uses: tlambert03/setup-qt-libs@v1 + - uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1 - name: Install Dependencies run: | @@ -32,7 +36,7 @@ jobs: sudo apt install graphviz --yes - name: Build Docs - uses: aganders3/headless-gui@v2 + uses: aganders3/headless-gui@f85dd6316993505dfc5f21839d520ae440c84816 # v2 with: run: make html working-directory: ./docs @@ -50,12 +54,14 @@ jobs: if: contains(github.ref, 'tags') steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/download-artifact@v4.3.0 with: name: docs - name: Push to GitHub pages - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4 with: folder: html ssh-key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 77853f7..0521c9e 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,4 +1,6 @@ name: tests +permissions: + contents: read on: push: @@ -17,6 +19,19 @@ concurrency: cancel-in-progress: true jobs: + pre-commit: + name: precommit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: "3.x" + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + with: + extra_args: --hook-stage manual --all-files test: name: ${{ matrix.platform }} py${{ matrix.python-version }} runs-on: ${{ matrix.platform }} @@ -28,6 +43,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -35,7 +52,7 @@ jobs: python-version: ${{ matrix.python-version }} # these libraries enable testing on Qt on linux - - uses: tlambert03/setup-qt-libs@v1 + - uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1 # strategy borrowed from vispy for installing opengl libs on windows - name: Install Windows OpenGL @@ -62,7 +79,7 @@ jobs: if: ${{ always() }} - name: Coverage - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 # Don't run coverage on merge queue CI to avoid duplicating reports # to codecov. See https://github.com/matplotlib/napari-matplotlib/issues/155 if: github.event_name != 'merge_group' @@ -84,6 +101,8 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Python uses: actions/setup-python@v5 with: @@ -99,4 +118,4 @@ jobs: python -m build . - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4