Skip to content

Commit

Permalink
Update files based on the repo-config 0.10.0 templates
Browse files Browse the repository at this point in the history
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
  • Loading branch information
llucax committed Aug 26, 2024
1 parent 8a7adce commit 3dadcc4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .github/containers/test-installation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ RUN apt-get update -y && \
python -m pip install --upgrade --no-cache-dir pip

COPY dist dist
RUN pip install dist/*.whl && \
rm -rf dist
# This git-credentials file is made available by the GitHub ci.yaml workflow
COPY git-credentials /root/.git-credentials
RUN git config --global credential.helper store && \
pip install dist/*.whl && \
rm -rf dist /root/.git-credentials
42 changes: 37 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
uses: frequenz-floss/gh-action-setup-git@v0.x.x

- name: Print environment (debug)
run: env

Expand Down Expand Up @@ -88,10 +91,14 @@ jobs:
# The job name should match the name of the `nox` job.
name: Test with nox
needs: ["nox"]
# We skip this job only if nox was also skipped
if: always() && needs.nox.result != 'skipped'
runs-on: ubuntu-20.04
env:
DEPS_RESULT: ${{ needs.nox.result }}
steps:
- name: Return true
run: "true"
- name: Check matrix job result
run: test "$DEPS_RESULT" = "success"

nox-cross-arch:
name: Cross-arch tests with nox
Expand All @@ -115,6 +122,9 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
uses: frequenz-floss/gh-action-setup-git@v0.x.x

- name: Fetch sources
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -161,7 +171,7 @@ jobs:
uses: actions/cache@v4
with:
path: /tmp/pip-cache
key: nox-${{ matrix.nox-session }}-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }}
key: nox-${{ matrix.nox-session }}-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}

# This ensures that the docker container has access to the pip cache.
# Changing the user in the docker-run step causes it to fail due to
Expand Down Expand Up @@ -202,15 +212,22 @@ jobs:
# The job name should match the name of the `nox-cross-arch` job.
name: Cross-arch tests with nox
needs: ["nox-cross-arch"]
# We skip this job only if nox-cross-arch was also skipped
if: always() && needs.nox-cross-arch.result != 'skipped'
runs-on: ubuntu-20.04
env:
DEPS_RESULT: ${{ needs.nox-cross-arch.result }}
steps:
- name: Return true
run: "true"
- name: Check matrix job result
run: test "$DEPS_RESULT" = "success"

build:
name: Build distribution packages
runs-on: ubuntu-20.04
steps:
- name: Setup Git
uses: frequenz-floss/gh-action-setup-git@v0.x.x

- name: Fetch sources
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -245,15 +262,24 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v4

- name: Download package
uses: actions/download-artifact@v4
with:
name: dist-packages
path: dist

- name: Make Git credentials available to docker
run: |
touch ~/.git-credentials # Ensure the file exists
cp ~/.git-credentials git-credentials || true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up docker-buildx
uses: docker/setup-buildx-action@v3

- name: Test Installation
uses: docker/build-push-action@v6
with:
Expand Down Expand Up @@ -431,6 +457,12 @@ jobs:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
id-token: write
steps:
- name: Setup Git
uses: frequenz-floss/gh-action-setup-git@v0.x.x

- name: Fetch sources
uses: actions/checkout@v4

- name: Download distribution files
uses: actions/download-artifact@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ plugins:
- literate-nav:
nav_file: SUMMARY.md
- mike:
alias_type: redirect
alias_type: symlink
canonical_version: latest
- mkdocstrings:
default_handler: python
Expand All @@ -111,6 +111,7 @@ plugins:
show_signature_annotations: true
show_source: true
show_symbol_type_toc: true
show_symbol_type_toc: true
signature_crossrefs: true
import:
# See https://mkdocstrings.github.io/python/usage/#import for details
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dev-mkdocs = [
"mkdocs-macros-plugin == 1.0.5",
"mkdocs-material == 9.5.33",
"mkdocstrings[python] == 0.25.2",
"mkdocstrings-python == 1.9.2",
"frequenz-repo-config[lib] == 0.10.0",
]
dev-mypy = [
Expand Down Expand Up @@ -138,8 +139,12 @@ disable = [
# pylint's unsubscriptable check is buggy and is not needed because
# it is a type-check, for which we already have mypy.
"unsubscriptable-object",
# Checked by mypy
"no-member",
# Checked by flake8
"f-string-without-interpolation",
"line-too-long",
"missing-function-docstring",
"redefined-outer-name",
"unnecessary-lambda-assignment",
"unused-import",
Expand Down

0 comments on commit 3dadcc4

Please sign in to comment.