Skip to content

Commit

Permalink
chore: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-sig committed Dec 20, 2024
1 parent d7186ce commit 1781d33
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,6 @@ jobs:
- name: Run build
run: make build

- name: Save Docker images
run: docker save $(docker images -q) -o docker-images.tar

- name: Upload Docker images
uses: actions/upload-artifact@v4
with:
name: docker-images
path: docker-images.tar

integration-api:
name: API Integration Tests
needs: [lint, test, build]
Expand All @@ -160,21 +151,26 @@ jobs:
with:
python-version: '3.12'

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

- name: Download Docker images
uses: actions/download-artifact@v4
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
name: docker-images
path: ~/.cache/poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Load Docker images
run: docker load -i docker-images.tar
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create false
poetry install
- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Start API service and run integration tests
run: |
docker compose up -d --pull never
pip install requests pytest
pytest tests/integration -v -m api_integration
docker compose down
Expand Down Expand Up @@ -251,16 +247,11 @@ jobs:
TAG=$(git describe --tags --abbrev=0)
echo "RELEASE_VERSION=${TAG}" >> $GITHUB_ENV
- name: Download Docker images
uses: actions/download-artifact@v4
with:
name: docker-images

- name: Load Docker images
run: docker load -i docker-images.tar

- name: Tag and push application images
- name: Build and push application images
run: |
# Build images
docker compose build
# Tag with version and latest
docker tag ghcr.io/gbourniq/portfolio_analytics/api ghcr.io/gbourniq/portfolio_analytics/api:${{ env.RELEASE_VERSION }}
docker tag ghcr.io/gbourniq/portfolio_analytics/api ghcr.io/gbourniq/portfolio_analytics/api:latest
Expand Down

0 comments on commit 1781d33

Please sign in to comment.