Skip to content

Commit

Permalink
Dependency bump
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Nov 27, 2024
1 parent 94acf20 commit 2a685af
Show file tree
Hide file tree
Showing 7 changed files with 1,278 additions and 1,356 deletions.
116 changes: 80 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ defaults:
shell: bash

jobs:

#-------------------------
# Building
#-------------------------
Expand All @@ -25,18 +24,18 @@ jobs:
is_merge_commit: ${{ steps.set_is_merge_commit.outputs.is_merge_commit }}
is_tag_build: ${{ steps.set_is_tag_build.outputs.is_tag_build }}
python_version: ${{ steps.set_python_version.outputs.python_version }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
fetch-tags: true

# Set up Python and Poetry and cache build dependencies
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: 'pip'
cache: "pip"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand All @@ -47,7 +46,7 @@ jobs:
plugins: |
poetry-dynamic-versioning[plugin]
poethepoet[poetry_plugin]
# Install and cache full build dependencies
- name: Load cached venv
id: cached-poetry-dependencies
Expand All @@ -59,12 +58,12 @@ jobs:
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --no-plugins

# Install node and yarn in order to build the front end during packaging
- name: Set Node.js 20.x
# Install node and yarn in order to build the front end during packaging
- name: Set Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
node-version: 22.x
cache: "yarn"
cache-dependency-path: locust/webui/yarn.lock
- name: Install Yarn
run: npm install -g yarn
Expand All @@ -83,15 +82,15 @@ jobs:
with:
name: webui-dist
path: locust/webui/dist/*

- name: Build UI library
run: yarn webui:build:lib
- name: Upload web UI library as Artifact
uses: actions/upload-artifact@v4
with:
name: webui-lib-dist
path: locust/webui/lib

# Set workflow metadata in one place so we can pull it out later
- id: set_tag
run: echo "tag=$(poetry version -s)" | tee -a "$GITHUB_OUTPUT"
Expand All @@ -111,7 +110,7 @@ jobs:
runs-on: ubuntu-latest
needs: build_package
steps:
- run: |
- run: |
echo "tag: ${{ needs.build_package.outputs.tag }}"
echo "tag_short: ${{ needs.build_package.outputs.tag_short }}"
echo "branch: ${{ needs.build_package.outputs.branch }}"
Expand All @@ -136,31 +135,76 @@ jobs:
- { name: "Ruff", python: "3.12.5", os: ubuntu-latest, tox: "ruff" }
- { name: "Mypy", python: "3.12.5", os: ubuntu-latest, tox: "mypy" }

# Verification of builds and other aspects
- { name: "Docs Build", python: "3.12.5", os: ubuntu-latest, tox: "docs" }
# Verification of builds and other aspects
- {
name: "Docs Build",
python: "3.12.5",
os: ubuntu-latest,
tox: "docs",
}

# OS Integration tests
- {
name: "Linux",
python: "3.12.5",
os: ubuntu-latest,
tox: fail_fast_test_main_external_package,
}
- {
name: "Windows",
python: "3.12.5",
os: windows-latest,
tox: fail_fast_test_main_external_package,
}
- {
name: "MacOS",
python: "3.12.5",
os: macos-latest,
tox: fail_fast_test_main_external_package,
}

# OS Integration tests
- { name: "Linux", python: "3.12.5", os: ubuntu-latest, tox: fail_fast_test_main_external_package }
- { name: "Windows", python: '3.12.5', os: windows-latest, tox: fail_fast_test_main_external_package }
- { name: "MacOS", python: '3.12.5', os: macos-latest, tox: fail_fast_test_main_external_package }

# Unit tests on Python versions
- { name: "Python 3.13", python: "3.13.0", os: ubuntu-latest, tox: py313 }
- { name: "Python 3.12", python: "3.12.5", os: ubuntu-latest, tox: py312 }
- { name: "Python 3.11", python: "3.11.9", os: ubuntu-latest, tox: py311 }
- { name: "Python 3.10", python: "3.10.14", os: ubuntu-latest, tox: py310 }
- { name: "Python 3.9", python: "3.9.20", os: ubuntu-latest, tox: py39 }
- {
name: "Python 3.13",
python: "3.13.0",
os: ubuntu-latest,
tox: py313,
}
- {
name: "Python 3.12",
python: "3.12.5",
os: ubuntu-latest,
tox: py312,
}
- {
name: "Python 3.11",
python: "3.11.9",
os: ubuntu-latest,
tox: py311,
}
- {
name: "Python 3.10",
python: "3.10.14",
os: ubuntu-latest,
tox: py310,
}
- {
name: "Python 3.9",
python: "3.9.20",
os: ubuntu-latest,
tox: py39,
}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Set up Python and Poetry
# Set up Python and Poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache: "pip"
cache-dependency-path: poetry.lock
- name: Install Poetry
uses: snok/install-poetry@v1
Expand Down Expand Up @@ -190,7 +234,7 @@ jobs:
with:
name: python-dist
path: dist

- name: Download WebUI dist
uses: actions/download-artifact@v4
with:
Expand All @@ -202,7 +246,7 @@ jobs:
run: |
source $VENV
tox -e ${{ matrix.tox }} --installpkg dist/*.whl
test_docker_image:
name: Test Docker Image
runs-on: ubuntu-latest
Expand All @@ -212,7 +256,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Grab the built artifacts to ensure we're testing what we eventually publish
- name: Download Python dist
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -246,11 +290,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
- name: Set Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
node-version: 22.x
cache: "yarn"
cache-dependency-path: locust/webui/yarn.lock
- uses: borales/actions-yarn@v5
with:
Expand Down Expand Up @@ -278,17 +322,17 @@ jobs:
# -------------------------

publish:
needs: [tox_tests, lint_typecheck_test_webui, test_docker_image, build_package]
needs:
[tox_tests, lint_typecheck_test_webui, test_docker_image, build_package]
if: github.repository_owner == 'locustio' && ( github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags') )
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0

# Download Python dist artifact
- name: Download Python dist
- name: Download Python dist
uses: actions/download-artifact@v4
with:
name: python-dist
Expand Down Expand Up @@ -353,7 +397,7 @@ jobs:
with:
cmd: publish --no-git-tag-version --non-interactive --tag next --new-version ${{ needs.build_package.outputs.tag_short }}-next-${{ github.run_id }}
dir: locust/webui

# On tag builds
- uses: borales/actions-yarn@v5
name: Publish package on NPM
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a local-use Docker image which illustrates the end-to-end build process for Locust

# Stage 1: Build web front end
FROM node:20.0.0-alpine AS webui-builder
FROM node:22.0.0-alpine AS webui-builder

ADD locust/webui locust/webui
ADD package.json .
Expand Down
41 changes: 0 additions & 41 deletions locust/webui/.eslintrc

This file was deleted.

83 changes: 83 additions & 0 deletions locust/webui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-plugin-prettier';
import unusedImports from 'eslint-plugin-unused-imports';
import _import from 'eslint-plugin-import';
import { fixupPluginRules } from '@eslint/compat';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends('plugin:@typescript-eslint/recommended'),
{
plugins: {
react,
'react-hooks': fixupPluginRules(reactHooks),
'@typescript-eslint': typescriptEslint,
prettier,
'unused-imports': unusedImports,
import: fixupPluginRules(_import),
},

languageOptions: {
parser: tsParser,
},

rules: {
'react/display-name': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'no-console': 'error',
'react/jsx-sort-props': 2,
'react/sort-prop-types': 2,
'import/order': [
'error',
{
groups: ['external', 'internal'],
'newlines-between': 'always',

alphabetize: {
order: 'asc',
caseInsensitive: true,
},

pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: 'App',
group: 'internal',
},
{
pattern: 'Report',
group: 'internal',
},
{
pattern:
'{api,assets,components,constants,hooks,pages,redux,styles,test,types,utils}/**',
group: 'internal',
},
],

distinctGroup: false,
pathGroupsExcludedImportTypes: ['internal'],
},
],
},
},
];
Loading

0 comments on commit 2a685af

Please sign in to comment.