Skip to content

Commit

Permalink
fix: unit tests pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
apsantiso committed Dec 5, 2023
1 parent 8bba19e commit 8a86401
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 58 deletions.
102 changes: 45 additions & 57 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,49 @@
# name: run-tests
# on:
# push:
# branches:
# - 'master'
# - 'develop'
# pull_request:
# branches:
# - 'master'
# - 'develop'
# jobs:
# run-tests:
# environment: test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [16.x]
# services:
# postgres:
# image: postgres:latest
# env:
# POSTGRES_DB: xCloud_test
# POSTGRES_PASSWORD: example
# POSTGRES_USER: postgres
# ports:
# - 5432:5432
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
name: Run Unit Tests
on:
push:
branches:
- 'master'
- 'develop'
pull_request:
branches:
- 'master'
- 'develop'
jobs:
run-tests:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
environment:
name: development
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repo
uses: actions/checkout@v3

# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# registry-url: 'https://npm.pkg.github.com'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'

# - run: echo "registry=https://registry.yarnpkg.com/" > .npmrc
# - run: echo "@internxt:registry=https://npm.pkg.github.com" >> .npmrc
# # You cannot read packages from other private repos with GITHUB_TOKEN
# # You have to use a PAT instead https://github.com/actions/setup-node/issues/49
# - run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }} >> .npmrc
# - run: echo "always-auth=true" >> .npmrc
# We should see why permissions field is not doing the job. This should be removed
- run: echo "registry=https://registry.yarnpkg.com/" > .npmrc
- run: echo "@internxt:registry=https://npm.pkg.github.com" >> .npmrc
# You cannot read packages from other private repos with GITHUB_TOKEN
# You have to use a PAT instead https://github.com/actions/setup-node/issues/49
- run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }} >> .npmrc
- run: echo "always-auth=true" >> .npmrc

# - name: Lint & Test
# run: yarn && yarn run test
- name: Setup environment
uses: isbang/[email protected]
with:
compose-file: './infrastructure/docker-compose.yml'

# - name: Test E2E
# env:
# RDS_HOSTNAME: localhost
# RDS_DBNAME: xCloud_test
# RDS_USERNAME: postgres
# RDS_PASSWORD: example
# RDS_PORT: 5432
# SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
# SENDGRID_MODE_SANDBOX: true
# APP_SEGMENT_KEY: ${{ secrets.APP_SEGMENT_KEY }}
# run: yarn migrate:test && yarn run test:e2e
- name: Install dependencies
run: yarn

- name: Run unit tests
run: yarn test
2 changes: 1 addition & 1 deletion infrastructure/development.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:20.10-alpine

WORKDIR /usr/app

Expand Down

0 comments on commit 8a86401

Please sign in to comment.