Files
kt_log/.gitea/workflows/test.yml
T
Matsubaa 9039518814
cargo build / build (push) Successful in 8s
cargo test / test (push) Successful in 4s
cargo test / publish (push) Failing after 3s
Update README with detailed usage instructions; switch workflows to MiniServ-nix-runner
2026-08-22 09:22:30 -05:00

60 lines
1.5 KiB
YAML

# .gitea/workflows/test.yml
name: cargo test
on:
push:
branches:
- main
- master
tags:
- v*
pull_request:
jobs:
test:
runs-on: nix
env:
CARGO_TARGET_DIR: /tmp/kt_log-target
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests (Nix dev shell)
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo test --verbose
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: nix
env:
CARGO_TARGET_DIR: /tmp/kt_log-target
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Cargo registry (Gitea)
run: |
mkdir -p ~/.cargo
cat > ~/.cargo/config.toml << 'EOF'
[registries.gitea]
index = "sparse+https://git.moturpin.com/api/packages/Matsubaa/cargo/"
EOF
- name: Write Cargo credentials
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
mkdir -p ~/.cargo
umask 077
cat > ~/.cargo/credentials.toml <<'EOF'
[registries.gitea]
token = "${CARGO_TOKEN}"
EOF
- name: Publish to Gitea Cargo registry
env:
CARGO_REGISTRIES_GITEA_TOKEN: ${{ secrets.CARGO_TOKEN }}
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo publish --registry gitea --token "${CARGO_TOKEN}" --verbose