Skip to content

Commit

Permalink
Merge branch 'main' into add-sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
rissson authored Nov 6, 2024
2 parents cfd95dd + 6ed8b7f commit e9a0961
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[build]
rustc-wrapper = "sccache"

[doc.extern-map.registries]
crates-io = "https://docs.rs/"
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ updates:
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: deps
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: deps
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: deps
43 changes: 33 additions & 10 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ name: Python CI
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
release:
types:
- released

env:
DEBIAN_FRONTEND: noninteractive
CARGO_INCREMENTAL: "false"
SCCACHE_GHA_ENABLED: "on"

jobs:
lint:
Expand All @@ -32,9 +35,15 @@ jobs:
python-version-file: "pyproject.toml"
cache: "poetry"
- run: poetry install --only=dev
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just
tool: just,sccache
- run: poetry run just ci-lint-${{ matrix.job }}
build:
strategy:
Expand All @@ -50,16 +59,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: pipx install poetry || true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- run: poetry install --only=dev
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just
tool: just,sccache
- run: poetry run just ci-build-python
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -102,7 +116,7 @@ jobs:
name: python-${{ matrix.python-version }}-build
path: dist
- run: |
PATH="/usr/lib/heimdal-servers:$PATḦ" poetry run just ci-test-python-${{ matrix.job }}
PATH="/usr/lib/heimdal-servers:$PATH" poetry run just ci-test-python-${{ matrix.job }}
check-python:
if: always()
needs:
Expand Down Expand Up @@ -175,6 +189,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux'
with:
Expand All @@ -183,10 +202,14 @@ jobs:
with:
only: "${{ matrix.cibw-only }}"
env:
CIBW_BEFORE_ALL_LINUX: "set -e; curl -sSf https://sh.rustup.rs | sh -s -- -y; yum install -y krb5-devel clang-devel || apk add krb5-dev clang-dev"
CIBW_BEFORE_ALL_MACOS: "set -e; curl -sSf https://sh.rustup.rs | sh -s -- -y; brew install llvm krb5"
CIBW_BEFORE_ALL_LINUX: "set -e; curl -sSf https://sh.rustup.rs | sh -s -- -y; cargo install sccache --locked; yum install -y krb5-devel clang-devel openssl-devel || apk add krb5-dev clang-dev openssl-dev"
CIBW_BEFORE_ALL_MACOS: "set -e; curl -sSf https://sh.rustup.rs | sh -s -- -y; cargo install sccache --locked; brew install llvm krb5"
CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
CIBW_ENVIRONMENT_MACOS: "PKG_CONFIG_PATH=/opt/homebrew/opt/krb5/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig MACOSX_DEPLOYMENT_TARGET=14.0"
CIBW_ENVIRONMENT_PASS_LINUX: "DEBIAN_FRONTEND CARGO_INCREMENTAL SCCACHE_GHA_ENABLED ACTIONS_CACHE_URL ACTIONS_RUNTIME_TOKEN"
CIBW_ENVIRONMENT_MACOS: >-
PKG_CONFIG_PATH=/opt/homebrew/opt/krb5/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig
MACOSX_DEPLOYMENT_TARGET=14.0
PATH=$HOME/.cargo/bin:$PATH"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
Expand Down Expand Up @@ -216,7 +239,7 @@ jobs:
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/python-kadmin-rs/version/')
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/python-kadmin-rs/version/')
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
54 changes: 40 additions & 14 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ name: Rust CI
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
release:
types:
- released

env:
DEBIAN_FRONTEND: noninteractive
CARGO_INCREMENTAL: "false"
SCCACHE_GHA_ENABLED: "on"

jobs:
lint:
Expand All @@ -29,17 +32,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.toolchain }}
name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: ${{ matrix.components }}
- if: ${{ ! matrix.toolchain }}
name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just
tool: just,sccache
- name: Lint
run: just ci-lint-${{ matrix.job }}
build:
Expand All @@ -48,9 +54,14 @@ jobs:
- uses: actions/checkout@v4
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just
tool: just,sccache
- name: Build
run: just ci-build-rust
test:
Expand Down Expand Up @@ -79,9 +90,14 @@ jobs:
run: poetry install --only=test
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just
tool: just,sccache
- name: Test
run: poetry run just ci-test-${{ matrix.job }}
check-rust:
Expand All @@ -107,18 +123,28 @@ jobs:
extra_args: "--no-verify"
- crate: kadmin
extra_args: ""
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup rust
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@v2
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
uses: taiki-e/install-action@v2
with:
tool: just
- run: just ci-build-deps
- if: github.event_name == 'push' && startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
tool: just,sccache
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
run: just ci-build-deps
- if: startsWith(github.ref, format('refs/tags/{0}/version/', matrix.crate))
run: cargo publish --package ${{ matrix.crate }} ${{ matrix.extra_args }}
10 changes: 5 additions & 5 deletions .github/workflows/release-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.event.pull_request.merged
outputs:
is-release: ${{ steps.meta.outputs.is-release }}
package: ${{ steps.meta.outputs.crates-name }}
package: ${{ steps.meta.outputs.crates-names }}
version: ${{ steps.meta.outputs.version-actual }}
runs-on: ubuntu-latest
steps:
Expand All @@ -24,16 +24,16 @@ jobs:

release-create:
needs:
- info
if: needs.info.outputs.is-release == 'true'
- release-info
if: needs.release-info.outputs.is-release == 'true'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v2
with:
name: "${{ needs.info.outputs.package }} ${{ needs.info.outputs.version }}"
tag_name: "${{ needs.info.outputs.package }}/version/${{ needs.info.outputs.version }}"
name: "${{ needs.release-info.outputs.package }} ${{ needs.release-info.outputs.version }}"
tag_name: "${{ needs.release-info.outputs.package }}/version/${{ needs.release-info.outputs.version }}"
target_commitish: "${{ github.sha }}"
draft: true
make_latest: true
12 changes: 11 additions & 1 deletion .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
required: true
type: string

env:
DEBIAN_FRONTEND: noninteractive
CARGO_INCREMENTAL: "false"
SCCACHE_GHA_ENABLED: "on"

jobs:
release-pr:
permissions:
Expand All @@ -28,9 +33,14 @@ jobs:
- uses: actions/checkout@v4
- uses: chainguard-dev/actions/setup-gitsign@main
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: taiki-e/install-action@v2
with:
tool: just,cargo-release,cargo-workspaces
tool: just,sccache,cargo-release,cargo-workspaces
- run: just ci-build-deps
- uses: cargo-bins/release-pr@v2
with:
Expand Down
Loading

0 comments on commit e9a0961

Please sign in to comment.