Merge pull request #137 from Ruben14789/main #238
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI workflow | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Grab Node Version | |
- name: Get Node Version | |
id: node | |
run: | | |
echo "::set-output name=version::$(node -v)" | |
# Grab Node Cache | |
- name: Get Node Modules Cache | |
uses: actions/cache@v3 | |
id: node_modules | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} | |
# ^ If the OS, yarn.lock, Node version doesn't change, this will use the workflow cache | |
# Set up Node Version | |
- name: Setup Node | |
uses: actions/setup-node@v3.1.1 | |
with: | |
node-version: v16.14.2 | |
cache: 'yarn' | |
cache-dependency-path: app/yarn.lock # <- This is needed for some reason, but the file is empty when I open it (Antonio) | |
# Install yarn and npm | |
- name: Install Dependencies | |
run: | | |
cd app | |
yarn install # <- yarn manages caching | |
npm install | |
# Print Coverage Report | |
- name: Print coverage report | |
run: | | |
cd app | |
npm run coverage | |
- name: Upload coverage reports to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${{ secrets.CODECOV_TOKEN }} | |