Repository navigation
64 lines (52 loc) · 2.23 KB
/
Copy pathpython-app.yml
File metadata and controls
64 lines (52 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install and start Kubo
working-directory: ${{ runner.temp }}
run: |
archive=kubo_v0.33.2_linux-amd64.tar.gz
checksum=9be2ba96fb313c5f85fb9539d1bbca3d0036f0bb2affff3879dc1ba485acbe17e22c7eb3cad88ed0420ea56ab739947ea26123c5ecd1d46445a83804308760fa
curl --fail --silent --show-error --location --retry 3 --max-time 60 \
--output "$archive" "https://github.com/ipfs/kubo/releases/download/v0.33.2/$archive"
printf '%s %s\n' "$checksum" "$archive" | sha512sum --check
tar -xzf "$archive" kubo/ipfs
export IPFS_PATH="$(mktemp -d)"
./kubo/ipfs init
nohup ./kubo/ipfs daemon > kubo.log 2>&1 &
if ! curl --fail --silent --retry 20 --retry-delay 1 --retry-connrefused \
--max-time 2 --request POST http://127.0.0.1:5001/api/v0/id > /dev/null; then
cat kubo.log
exit 1
fi
echo "$RUNNER_TEMP/kubo" >> "$GITHUB_PATH"
echo "IPFS_PATH=$IPFS_PATH" >> "$GITHUB_ENV"
- name: Swarm peering add to our IPFS Servers
run: |
ipfs swarm peering add "${{vars.FLUORINE_MULTIADDRESS}}"
ipfs swarm peering add "${{vars.CERIUM_MULTIADDRESS}}"
ipfs swarm peering add "${{vars.BISMUTH_MULTIADDRESS}}"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
python-version: "3.12"
- name: Install all dependencies
run: uv sync --locked --extra dev --extra testing
- name: Run pytest with coverage
run: uv run pytest --cov=dclimate_client_py tests/ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}