Skip to content

CI - Node.js Curriculum #12

CI - Node.js Curriculum

CI - Node.js Curriculum #12

name: CI - Node.js Curriculum
on:
workflow_dispatch:
pull_request:
branches:
- 'main'
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Files
uses: actions/[email protected]
- name: Remove English
run: |
rm -rf curriculum/challenges/english/
rm -rf curriculum/dictionaries/english/
- name: Clone freeCodeCamp Repo
run: git clone https://github.com/freeCodeCamp/freeCodeCamp.git
- name: Remove i18n Challenges from freeCodeCamp
run: |
rm -rf freeCodeCamp/curriculum/{challenges/{arabic,chinese,chinese-traditional,espanol,german,italian,japanese,korean,portuguese,swahili,ukrainian},dictionaries/{arabic,chinese,chinese-traditional,espanol,german,italian,japanese,korean,portuguese,swahili,ukrainian}}
- name: Copy i18n Challenges
run: |
cp -r curriculum/challenges/* freeCodeCamp/curriculum/challenges/
cp -r curriculum/dictionaries/* freeCodeCamp/curriculum/dictionaries/
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Use Node.js 20.x
uses: actions/[email protected]
with:
node-version: 20.x
cache: pnpm
- name: Set Environment variables
run: |
cp freeCodeCamp/sample.env freeCodeCamp/.env
cat freeCodeCamp/.env
- name: Install node_modules
run: cd freeCodeCamp && pnpm install
outputs:
freecodecamp_path: freeCodeCamp
build:
needs: setup
runs-on: ubuntu-22.04
strategy:
matrix:
locale:
- 'arabic'
- 'chinese'
- 'chinese-traditional'
- 'espanol'
- 'german'
- 'italian'
- 'japanese'
- 'korean'
- 'portuguese'
- 'swahili'
- 'ukrainian'
fail-fast: false
steps:
- name: Checkout Source Files
uses: actions/[email protected]
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Use Node.js 20.x
uses: actions/[email protected]
with:
node-version: 20.x
cache: pnpm
- name: Copy i18n Challenges
run: cp -r curriculum/challenges/* freeCodeCamp/curriculum/challenges/
- name: Build Client in ${{ matrix.locale }}
env:
CURRICULUM_LOCALE: ${{ matrix.locale }}
CLIENT_LOCALE: ${{ matrix.locale }}
run: |
cd freeCodeCamp && pnpm run build
- name: Audit Challenges
env:
CURRICULUM_LOCALE: ${{ matrix.locale }}
CLIENT_LOCALE: ${{ matrix.locale }}
run: cd freeCodeCamp && pnpm run audit-challenges
- name: Run Tests
env:
CURRICULUM_LOCALE: ${{ matrix.locale }}
CLIENT_LOCALE: ${{ matrix.locale }}
run: cd freeCodeCamp && pnpm test:curriculum
# name: CI - Node.js
# on:
# workflow_dispatch:
# pull_request:
# branches:
# - "main"
# permissions:
# contents: read
# jobs:
# lint:
# name: Build i18n Curriculum
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# node-version: [20.x]
# locale:
# - "arabic"
# - "chinese"
# - "chinese-traditional"
# - "espanol"
# - "german"
# - "italian"
# - "japanese"
# - "korean"
# - "portuguese"
# - "swahili"
# - "ukrainian"
# fail-fast: false
# steps:
# - name: Checkout Source Files
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# - name: Remove English
# run: |
# rm -rf curriculum/challenges/english/
# rm -rf curriculum/dictionaries/english/
# - name: Clone freeCodeCamp Repo
# run: |
# git clone https://github.com/freeCodeCamp/freeCodeCamp.git
# # Todo: Remove this step after we remove the files from the repo
# - name: Remove i18n Challenges from freeCodeCamp
# run: |
# rm -rf freeCodeCamp/curriculum/challenges/arabic
# rm -rf freeCodeCamp/curriculum/challenges/chinese
# rm -rf freeCodeCamp/curriculum/challenges/chinese-traditional
# rm -rf freeCodeCamp/curriculum/challenges/espanol
# rm -rf freeCodeCamp/curriculum/challenges/german
# rm -rf freeCodeCamp/curriculum/challenges/italian
# rm -rf freeCodeCamp/curriculum/challenges/japanese
# rm -rf freeCodeCamp/curriculum/challenges/korean
# rm -rf freeCodeCamp/curriculum/challenges/portuguese
# rm -rf freeCodeCamp/curriculum/challenges/swahili
# rm -rf freeCodeCamp/curriculum/challenges/ukrainian
# rm -rf freeCodeCamp/curriculum/dictionaries/arabic
# rm -rf freeCodeCamp/curriculum/dictionaries/chinese
# rm -rf freeCodeCamp/curriculum/dictionaries/chinese-traditional
# rm -rf freeCodeCamp/curriculum/dictionaries/espanol
# rm -rf freeCodeCamp/curriculum/dictionaries/german
# rm -rf freeCodeCamp/curriculum/dictionaries/italian
# rm -rf freeCodeCamp/curriculum/dictionaries/japanese
# rm -rf freeCodeCamp/curriculum/dictionaries/korean
# rm -rf freeCodeCamp/curriculum/dictionaries/portuguese
# rm -rf freeCodeCamp/curriculum/dictionaries/swahili
# rm -rf freeCodeCamp/curriculum/dictionaries/ukrainian
# - name: Debug
# run: |
# ls -la
# echo "----------------"
# ls -la freeCodeCamp
# echo "----------------"
# ls -la freeCodeCamp/curriculum/challenges
# echo "----------------"
# ls -la freeCodeCamp/curriculum/dictionaries
# - name: Copy i18n Challenges
# run: |
# cp -r curriculum/challenges/* freeCodeCamp/curriculum/challenges
# cp -r curriculum/dictionaries/* freeCodeCamp/curriculum/dictionaries
# - name: Debug
# run: |
# ls -la freeCodeCamp/curriculum/challenges
# echo "----------------"
# ls -la freeCodeCamp/curriculum/dictionaries
# - name: Setup pnpm
# uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0
# with:
# version: 8
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
# with:
# node-version: ${{ matrix.node-version }}
# cache: pnpm
# - name: Set Environment variables
# run: |
# cp freeCodeCamp/sample.env freeCodeCamp/.env
# cat freeCodeCamp/.env
# - name: Install node_modules
# run: cd freeCodeCamp && pnpm install
# # DONT REMOVE THIS STEP.
# # TODO: Refactor and use re-usable workflow and shared artifacts
# - name: Build Client in ${{ matrix.locale }}
# env:
# CURRICULUM_LOCALE: ${{ matrix.locale }}
# CLIENT_LOCALE: ${{ matrix.locale }}
# run: |
# cd freeCodeCamp && pnpm run build
# - name: Audit Challenges
# env:
# CURRICULUM_LOCALE: ${{ matrix.locale }}
# CLIENT_LOCALE: ${{ matrix.locale }}
# run: cd freeCodeCamp && pnpm run audit-challenges
# - name: Run Tests
# env:
# CURRICULUM_LOCALE: ${{ matrix.locale }}
# CLIENT_LOCALE: ${{ matrix.locale }}
# run: cd freeCodeCamp && pnpm test:curriculum