From 6d67b6f81eb0d3011def997fe201c30aa623fe6e Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Mon, 2 Sep 2024 18:36:42 +0200 Subject: [PATCH] ci: update actions --- .github/workflows/e2e-tests.yml | 43 +++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 38 ++--------------------------- 2 files changed, 45 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/e2e-tests.yml diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml new file mode 100644 index 00000000..d886f68c --- /dev/null +++ b/.github/workflows/e2e-tests.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: ["main"] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Tests + timeout-minutes: 20 + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + - name: Enable Corepack + run: corepack enable + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "yarn" + - name: Install dependencies + run: yarn install --immutable + - name: E2E Tests + env: + GENAI_API_KEY: ${{ secrets.GENAI_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # TODO: enable WatsonX later + # WATSONX_API_KEY: ${{ secrets.WATSONX_API_KEY }} + # WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }} + # WATSONX_SPACE_ID: ${{ secrets.WATSONX_SPACE_ID }} + # WATSONX_DEPLOYMENT_ID: ${{ secrets.WATSONX_DEPLOYMENT_ID }} + run: yarn test:e2e diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85779a76..febdb2e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,9 +11,9 @@ concurrency: cancel-in-progress: true jobs: - lint: + main: timeout-minutes: 20 - name: Lint & Build + name: Lint & Build & Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,39 +34,5 @@ jobs: run: yarn commitlint --verbose --from "${{ github.event.pull_request.base.sha || github.event.commits[0].id }}" --to "${{ github.event.pull_request.head.sha || github.event.head_commit.id }}" - name: Build run: yarn build - - test: - name: Tests - timeout-minutes: 20 - needs: - - lint - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - name: Enable Corepack - run: corepack enable - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - name: Unit Tests run: yarn test:unit - - name: E2E Tests - env: - GENAI_API_KEY: ${{ secrets.GENAI_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # TODO: enable WatsonX later - # WATSONX_API_KEY: ${{ secrets.WATSONX_API_KEY }} - # WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }} - # WATSONX_SPACE_ID: ${{ secrets.WATSONX_SPACE_ID }} - # WATSONX_DEPLOYMENT_ID: ${{ secrets.WATSONX_DEPLOYMENT_ID }} - run: yarn test:e2e