fix: patch old versions selector to hide unreleased versions #7816
This file contains hidden or 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
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
env: | |
NODE_ENV: test | |
TRANSCRYPT_KEY: ${{ secrets.TRANSCRYPT_KEY }} | |
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }} | |
BACKEND_API_URL: http://localhost:1234/backend | |
ENABLE_FOOD_SECTION: "True" | |
ENABLE_OBJECTS_SECTION: "True" | |
EMAIL_SERVER_HOST: localhost | |
EMAIL_SERVER_PORT: 1025 | |
EMAIL_SERVER_USE_TLS: false | |
on: | |
push: | |
branches: [ master, staging ] | |
pull_request: | |
branches: [ master, staging ] | |
workflow_dispatch: | |
jobs: | |
build: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
# Same as Scalingo | |
image: postgres:14 | |
env: | |
POSTGRES_DB: ecobalyse_test | |
POSTGRES_USER: ecobalyse | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5433:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
matrix: | |
node-version: [22.x] | |
python-version: [3.12] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install transcrypt | |
run: | | |
mkdir -p $HOME/.local/bin | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
wget https://raw.githubusercontent.com/elasticdog/transcrypt/016b2e4b31951be5ea96233d8d2badef9c9836b6/transcrypt -O "$HOME/.local/bin/transcrypt" | |
chmod +x "$HOME/.local/bin/transcrypt" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Cache node_modules | |
id: cache-node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('package.json', 'package-lock.json') }} | |
- name: Cache ~/.elm | |
# see https://docs.microsoft.com/en-us/answers/questions/510640/deploy-elm-app-to-azure-static-website-from-github.html | |
uses: actions/cache@v4 | |
with: | |
path: ~/.elm | |
key: elm-cache-${{ hashFiles('elm.json') }} | |
restore-keys: elm-cache- | |
- name: Install Node dependencies | |
run: npm ci --prefer-offline --no-audit | |
- name: Check JSON db formating | |
run: npm run db:validate | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gettext | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: "latest" | |
python-version: ${{ matrix.python-version }} | |
- name: Build app | |
run: npm run build --if-present | |
- name: Run prettier, openapi & ruff formatting check | |
run: npm run lint:all | |
- name: Run elm-review | |
run: npm run test:review | |
- name: Run client tests | |
run: npm run test:client | |
- name: Run server tests | |
run: npm run test:server && npm run test:backend | |
# e2e tests | |
- name: Install Playwright Browsers | |
run: npx playwright install chromium --with-deps | |
- name: Run Playwright tests | |
run: NODE_ENV=test npm run test:e2e | |
- name: Upload Playwright test artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 3 |