Add github action

This commit is contained in:
Jeremie Pardou 2023-12-30 17:24:24 +01:00
parent 0df6a5097c
commit ec2915d1d5
2 changed files with 32 additions and 49 deletions

View File

@ -1,49 +0,0 @@
# Javascript Node CircleCI 2.0 configuration file
#
jobs:
test-job:
docker:
- image: "cimg/node:lts"
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run: yarn setup
- save_cache:
paths:
- node_modules
- client/node_modules
- server/node_modules
key: dependencies-{{ checksum "yarn.lock" }}
- run:
command: yarn lint
- run:
command: yarn test
environment:
TZ: UTC
VITE_COMMIT_SHA: some_sha
- store_artifacts: # For coverage report
path: client/coverage
orbs: # declare what orbs we are going to use
node: circleci/node@2.0.2 # the node orb provides common node-related configuration
version: 2.1
workflows:
tests:
jobs:
- test-job

32
.github/workflows/lint-test.yml vendored Normal file
View File

@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i yarn -g
- run: yarn setup
env:
TZ: UTC
VITE_COMMIT_SHA: some_sha
- run: yarn lint
- run: yarn test