-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Migrate package manager to uv #1553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2427c6e
3bddc96
a2637b0
d556e44
08e2a71
8fd29b3
5c44e0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v6 | ||
| - name: Lint | ||
| run: | | ||
| set -e | ||
|
|
@@ -21,22 +21,37 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v6 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| version: "0.11.19" | ||
| enable-cache: true | ||
| - name: Generate OpenAPI schema | ||
| run: | | ||
| make install | ||
| make install-base | ||
| make openapi-generate | ||
| sqlite: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| version: "0.11.19" | ||
| enable-cache: true | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Start pokeapi | ||
| run: | | ||
| make install | ||
| make migrate | ||
| make install-base | ||
| make setup | ||
| make build-db | ||
| nohup make serve & | ||
| sleep 3 | ||
|
|
@@ -48,25 +63,23 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| - name: Build | ||
| - name: Build and start services | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not building anymore, just starting the services.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. docker compose up does build the image too if it dosent exist (which it dosent when this task first runs) but ill also add a |
||
| run: | | ||
| docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d --build | ||
| - name: Run migrations and build database | ||
| run: | | ||
| docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d | ||
| make docker-migrate | ||
| make docker-build-db | ||
| - name: Dump DB | ||
| run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash -N 'hdb_*' pokeapi > pokeapi.dump" | ||
| - name: Copy dump | ||
| run: docker compose cp db:/tmp/pokeapi.dump ./ | ||
| - name: Down services | ||
| run: docker compose -f docker-compose.yml -f docker-compose-dev.yml down -v | ||
| - name: Start services | ||
| run: docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d | ||
| - name: Import database | ||
| run: docker compose exec -T db pg_dump -U ash -Fc -N 'hdb_*' pokeapi > pokeapi.dump | ||
| - name: Drop and recreate database | ||
| run: | | ||
| docker compose cp ./pokeapi.dump db:/tmp/ | ||
| docker compose exec -T -u postgres db sh -c "cd /tmp && pg_restore -h localhost -U ash -d pokeapi pokeapi.dump" | ||
| docker compose exec -T db psql -U ash -d postgres -c "DROP DATABASE pokeapi WITH (FORCE);" | ||
| docker compose exec -T db psql -U ash -d postgres -c "CREATE DATABASE pokeapi;" | ||
| - name: Import database | ||
| run: docker compose exec -T db pg_restore -U ash -d pokeapi < pokeapi.dump | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we put back
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the default behavior for dump and restore for postgresql isnt localhost or the local loopback address instead it uses the unix socket (file based) which is faster without the tcp/ip overhead I can force it to use localhost if required though but imo there is no particular reason to go through localhost previously the docker invocation was using
in the new workflow the commands run as the container default execution user so we dont run into any permission misalignments for file r/w |
||
| - name: Test data | ||
| run: curl -Ss http://localhost/api/v2/pokemon/1/ | grep -q 'bulbasaur' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.14 | ||
|
FallenDeity marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.