Skip to content

feat: first draft of saleor historic orders, including updates to ken… #474

feat: first draft of saleor historic orders, including updates to ken…

feat: first draft of saleor historic orders, including updates to ken… #474

Workflow file for this run

name: CI
## This workflow should run on all PR and test the whole system. It should skip the run,
## if "chore(release)" is in the commit message.
on:
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Build
run: make build
# - name: Lint
# run: pnpm lint
- name: Check types
run: pnpm tsc --pretty
- name: Format
run: pnpm prettier --check .
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
service: [api, worker]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: false
file: ./services/${{ matrix.service }}/Dockerfile
tags: eci_${{ matrix.service }}:latest
build-args: commit_sha=${{ github.sha }}
outputs: type=docker,dest=/tmp/${{ matrix.service }}.tar
cache-from: type=gha
cache-to: type=gha,mode=max
# export docker images to be used in next jobs below
- name: Upload image ${{ matrix.service }} as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.service }}
path: /tmp/${{ matrix.service }}.tar
retention-days: 1
release-worker:
name: Release worker
needs:
- build
- test
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
steps:
- name: Load images from artifacts
uses: actions/download-artifact@v3
with:
path: images
- name: Load docker images
run: |
docker load -i images/worker/worker.tar
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/worker
- name: Tag image
run: docker tag eci_worker ${{ steps.meta.outputs.tags }}
- name: Push image
run: docker push ${{ steps.meta.outputs.tags }}
# e2e:
# name: Integration
# needs:
# - test
# - build
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# saleor: [
# "ghcr.io/saleor/saleor:3.0.0"
# ]
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - uses: pnpm/action-setup@v2
# with:
# version: 7
# - uses: actions/setup-node@v3
# with:
# node-version: '14'
# cache: 'pnpm'
# - run: pnpm install --frozen-lockfile
# # load docker images from build jobs
# - name: Load images from artifacts
# uses: actions/download-artifact@v3
# with:
# path: images
# - name: Load docker images
# run: |
# docker load -i images/api/api.tar & docker load -i images/worker/worker.tar
# # Necesarry to test against the predefined saleor versions
# - name: Use docker-compose ci config
# run: cp docker-compose.ci.yml docker-compose.override.yml
# # Pull the latest image to build, and avoid caching pull-only images.
# # (docker pull is faster than caching in most cases.)
# - run: docker-compose pull --ignore-pull-failures
# env:
# SALEOR_IMAGE: ${{ matrix.saleor }}
# - name: Start services
# run: docker-compose up -d
# env:
# SALEOR_IMAGE: ${{ matrix.saleor }}
# DATABASE_URL: mysql://eci:[email protected]/eci
# ECI_BASE_URL: http://localhost:3000
# ECI_BASE_URL_FROM_CONTAINER: http://api.eci:3000
# SALEOR_URL_FROM_CONTAINER: http://saleor.eci:8000/graphql/
# SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
# REDIS_HOST: localhost
# REDIS_PORT: 6379
# REDIS_PASSWORD: hi
# ECI_ENV: ci
# VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
# KAFKA_BROKER_URL: "kafka:9092"
# - name: Migrate saleor schema
# run: make migrate-saleor
# - name: Migrate eci schema
# run: pnpm prisma db push --force-reset
# env:
# DATABASE_URL: mysql://eci:eci@localhost/eci
# - name: Generate code
# run: make build
# - name: Test
# run: pnpm jest --testPathIgnorePatterns="./e2e/|./services/worker/" -i
# env:
# SALEOR_URL: http://localhost:8000/graphql/
# ECI_BASE_URL: http://localhost:3000
# DATABASE_URL: mysql://eci:eci@localhost/eci
# ZOHO_CLIENT_SECRET: ${{ secrets.ZOHO_CLIENT_SECRET }}
# ZOHO_CLIENT_ID: ${{ secrets.ZOHO_CLIENT_ID }}
# ZOHO_ORG_ID: ${{ secrets.ZOHO_ORG_ID }}
# ECI_BASE_URL_FROM_CONTAINER: http://api.eci:3000
# ECI_ENV: development
# REDIS_HOST: localhost
# REDIS_PORT: 6379
# REDIS_PASSWORD: hi
# - run: docker-compose logs
# if: always()