Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
version: 2.1
executors:
reviewed:
docker:
- image: cimg/aws@sha256:4cf3768db00ddf9bc439b8c84e8a60c11a14edf81c8baf76f74132144f8340d5
commands:
checkout-source:
steps:
- run:
name: Check out the exact public source commit over HTTPS
command: |
set -euo pipefail
[[ "$CIRCLE_SHA1" =~ ^[0-9a-f]{40}$ ]]
export GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_GLOBAL=/dev/null GIT_TERMINAL_PROMPT=0
git init --quiet .
git remote add origin https://github.com/topcoder-platform/freeCodeCamp.git
git -c credential.helper= fetch --quiet --depth 1 origin "$CIRCLE_SHA1"
git checkout --quiet --detach FETCH_HEAD
test "$(git rev-parse HEAD)" = "$CIRCLE_SHA1"
checkout-suite:
steps:
- run:
name: Verify deployment suite v2.0.5
command: 'set -euo pipefail

git init --quiet /tmp/tc-deploy-scripts

git -C /tmp/tc-deploy-scripts remote add origin https://github.com/topcoder-platform/tc-deploy-scripts.git

git -C /tmp/tc-deploy-scripts fetch --quiet --depth 1 origin refs/tags/v2.0.5

git -C /tmp/tc-deploy-scripts checkout --quiet --detach FETCH_HEAD

test "$(git -C /tmp/tc-deploy-scripts rev-parse HEAD)" = bff574ab5c0b46773e25d2af1eff76675fba2ba5

'
jobs:
build:
executor: reviewed
steps:
- checkout-source
- setup_remote_docker
- checkout-suite
- run:
name: Build committed source without AWS or broker credentials
command: 'set -euo pipefail

python3 -I /tmp/tc-deploy-scripts/build_image.py --dockerfile docker/api/ECSDockerfile --image freecodecamp-api:candidate

mkdir -p /tmp/release

docker save --output /tmp/release/image.tar freecodecamp-api:candidate

'
no_output_timeout: 30m
- persist_to_workspace:
root: /tmp/release
paths:
- image.tar
deploy:
executor: reviewed
parameters:
environment:
type: enum
enum:
- dev
- prod
environment:
DEPLOY_ENV: << parameters.environment >>
steps:
- checkout-source
- setup_remote_docker
- checkout-suite
- attach_workspace:
at: /tmp/release
- run:
name: Promote a scanned digest with repository-bound OIDC
command: 'set +x

set -euo pipefail

test -f "deploy/${DEPLOY_ENV}.json"

docker load --input /tmp/release/image.tar

python3 -I deploy/release.py "deploy/${DEPLOY_ENV}.json"

'
no_output_timeout: 45m
workflows:
release:
jobs:
- build
- deploy:
name: deploy-dev
environment: dev
requires:
- build
context: freeCodeCamp-dev-deploy
serial-group: << pipeline.project.slug >>/deploy-dev
filters:
branches:
only: dev
tags:
ignore: /.*/
- approve-prod:
type: approval
requires:
- build
filters:
branches:
only: prod
tags:
ignore: /.*/
- deploy:
name: deploy-prod
environment: prod
requires:
- approve-prod
context: freeCodeCamp-prod-deploy
serial-group: << pipeline.project.slug >>/deploy-prod
filters:
branches:
only: prod
tags:
ignore: /.*/
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ client/public
*Dockerfile*
*docker-compose*
**/node_modules

.env*
*_env
awsenvconf
**/.aws
**/.ssh
config/env.json
api-server/lib
deploy/iam
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ config/certification-settings.js
config/superblock-order.js
web/**
docs/**/*.md

tools/ui-components/storybook-static/**
tools/challenge-editor/client/build/**
14 changes: 11 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/order": "error",
"import/no-cycle": [2, { "maxDepth": 2 }],
"import/no-cycle": [
2,
{
"maxDepth": 2
}
],
"react/prop-types": "off",
"no-only-tests/no-only-tests": "error",
"no-unused-vars": "off",
Expand All @@ -60,7 +65,8 @@
"./tools/ui-components/tsconfig.json",
"./utils/tsconfig.json",
"./web/tsconfig.json",
"./curriculum-server/tsconfig.json"
"./curriculum-server/tsconfig.json",
"./tools/challenge-editor/client/tsconfig.json"
]
},
"extends": [
Expand Down Expand Up @@ -135,7 +141,9 @@
"plugin:testing-library/react",
"plugin:jest-dom/recommended"
],
"rules": { "import/named": 2 }
"rules": {
"import/named": 2
}
},
{
"files": ["cypress/**/*.js"],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codesee-diagram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
test_map_action:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
if: ${{ github.actor != 'renovate[bot]' && github.actor != 'camperbot' }}
continue-on-error: true
name: Run CodeSee Map Analysis
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }}
with:
node-version: '16'
node-version: '22'

- name: Configure Python 3.x
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # tag=v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/crowdin-download.curriculum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ env:
jobs:
i18n-download-curriculum-translations:
name: Curriculum
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [16.x]
node-version: [22.x]
fail-fast: true

steps:
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
- name: Build Source Files
run: |
echo npm version $(npm -v)
npm ci
npm ci --legacy-peer-deps --install-links=true
npm run create:config
npm run build:curriculum
npm run build:server
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/e2e-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
mobile-test:
name: Test curriculum for mobile app
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout Source Files
Expand All @@ -25,10 +25,10 @@ jobs:
repository: freeCodeCamp/mobile
path: mobile

- name: Use Node.js 16.x
- name: Use Node.js 22.x
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: 16.x
node-version: 22.x

- name: Setup Flutter 3.3.x
uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # tag=v2
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Install and Build
run: |
npm ci
npm ci --legacy-peer-deps --install-links=true
npm run create:config
npm run build:curriculum

Expand All @@ -56,9 +56,13 @@ jobs:
flutter pub get
flutter test test/widget_test.dart

- name: Install matching Cypress binary
run: node cypress-install.js

- name: Cypress run
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@18016a55674bd02cabf197de5762a1710cb5577c # v7.4.9
with:
install: false
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
start: npx serve
wait-on: http://localhost:3000
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/e2e-third-party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
do-everything:
name: Build & Test
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
services:
mongodb:
image: mongo:4.4
Expand All @@ -34,10 +34,10 @@ jobs:
repository: freeCodeCamp/client-config
path: client-config

- name: Use Node.js 16.x
- name: Use Node.js 22.x
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
with:
node-version: 16.x
node-version: 22.x

- name: Set freeCodeCamp Environment Variables
run: |
Expand All @@ -49,16 +49,20 @@ jobs:

- name: Install and Build
run: |
npm ci
npm ci --legacy-peer-deps --install-links=true
npm run build
- name: Seed Database
run: npm run seed
- name: Move serve.json to Public Folder
run: cp client-config/serve.json client/public/serve.json

- name: Install matching Cypress binary
run: node cypress-install.js

- name: Cypress run
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@18016a55674bd02cabf197de5762a1710cb5577c # v7.4.9
with:
install: false
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
start: npm run start-ci
wait-on: http://localhost:8000
Expand Down
Loading
Loading