diff --git a/.github/workflows/cron-release.yml b/.github/workflows/cron-release.yml index 97e2af89..112aaa7d 100644 --- a/.github/workflows/cron-release.yml +++ b/.github/workflows/cron-release.yml @@ -34,6 +34,11 @@ jobs: node-version: '20' cache: 'npm' + - name: 'Install python 3.13' + uses: actions/setup-python@v5 + with: + python-version: '3.13' + # FIXME: reuse pr-checks.yml? - name: 'Checks' run: | @@ -55,7 +60,7 @@ jobs: # used in npm run build echo "PULP_UI_VERSION=$(git rev-parse HEAD)" >> $GITHUB_ENV - - name: "git config" + - name: 'git config' run: | git config --local user.name "cron-release workflow" git config --local user.email "pulp-ui+cron-release@example.com" @@ -78,16 +83,16 @@ jobs: - name: 'Build UI dist/' run: 'npm run build' - - name: "Build a tarball" + - name: 'Build a tarball' run: | tar -C dist/ -czvf "$TARBALL" . - - name: "Push, push tags" + - name: 'Push, push tags' run: | git push git push -f --tags - - name: "Release" + - name: 'Release' run: | gh release create v"$NPM_VERSION" --title "pulp-ui $NPM_VERSION $(date --iso=d)" --generate-notes gh release upload v"$NPM_VERSION" "$TARBALL" --clobber diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 6b077d1c..63e7a4e0 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,68 +1,70 @@ -name: "PR checks" +name: 'PR checks' on: pull_request: - branches: [ 'main' ] + branches: ['main'] jobs: - pr-checks: runs-on: ubuntu-latest steps: + - name: 'Checkout pulp-ui (${{ github.ref }})' + uses: actions/checkout@v4 - - name: "Checkout pulp-ui (${{ github.ref }})" - uses: actions/checkout@v4 + - name: 'Install node 20' + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' - - name: "Install node 20" - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' + - name: 'Install python 3.13' + uses: actions/setup-python@v5 + with: + python-version: '3.13' - - name: "Checks" - run: | - # fail if npm install had to change package-lock.json - npm install - git diff --exit-code package-lock.json + - name: 'Checks' + run: | + # fail if npm install had to change package-lock.json + npm install + git diff --exit-code package-lock.json - # dependencies - npm run lint-setup-break-system-packages + # dependencies + npm run lint-setup - # run linters - npm run lint + # run linters + npm run lint - # uses `this` but not `class` - sudo apt install -y ripgrep - rg '\bclass\b' src/ | cut -d: -f1 | sort -u > src.class - rg '\bthis[\.,)\]}]\b' src/ | cut -d: -f1 | sort -u > src.this - if [ `comm -13 src.class src.this | wc -l` -ne 0 ]; then - echo - echo "Files using this but not class:" - echo - comm -13 src.class src.this - echo - rg '\bthis[\.,)\]}]\b' `comm -13 src.class src.this` - echo - exit 1 - fi + # uses `this` but not `class` + sudo apt install -y ripgrep + rg '\bclass\b' src/ | cut -d: -f1 | sort -u > src.class + rg '\bthis[\.,)\]}]\b' src/ | cut -d: -f1 | sort -u > src.this + if [ `comm -13 src.class src.this | wc -l` -ne 0 ]; then + echo + echo "Files using this but not class:" + echo + comm -13 src.class src.this + echo + rg '\bthis[\.,)\]}]\b' `comm -13 src.class src.this` + echo + exit 1 + fi merge-commits: runs-on: ubuntu-latest steps: + # need to checkout out head, the merge commit won't have any merges in history + # also need more than 1 commit, assuming no PR will have more than 128 + - name: 'Checkout pulp-ui HEAD' + uses: actions/checkout@v4 + with: + fetch-depth: 128 + ref: ${{ github.event.pull_request.head.sha }} - # need to checkout out head, the merge commit won't have any merges in history - # also need more than 1 commit, assuming no PR will have more than 128 - - name: "Checkout pulp-ui HEAD" - uses: actions/checkout@v4 - with: - fetch-depth: 128 - ref: ${{ github.event.pull_request.head.sha }} - - - name: "Ensure no merge commits" - run: | - # fail on merge commits in the PR - # since squash&merge doesn't create merge commits, - # and the last non-squash merges were in Jul 2019, - # we can just look for any merge commits since 2020 - count=`git log --min-parents=2 --since 2020-01-01 | tee /dev/stderr | wc -l` - [ "$count" = 0 ] + - name: 'Ensure no merge commits' + run: | + # fail on merge commits in the PR + # since squash&merge doesn't create merge commits, + # and the last non-squash merges were in Jul 2019, + # we can just look for any merge commits since 2020 + count=`git log --min-parents=2 --since 2020-01-01 | tee /dev/stderr | wc -l` + [ "$count" = 0 ] diff --git a/package-lock.json b/package-lock.json index 572da863..89925bb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "css-loader": "^7.1.2", "cypress": "^13.15.0", "cypress-file-upload": "^5.0.8", - "eslint": "~9.12.0", + "eslint": "~9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-react": "^7.37.1", "fork-ts-checker-webpack-plugin": "^9.0.2", @@ -1991,9 +1991,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2035,9 +2035,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6261,17 +6261,17 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.13.0", "@eslint/plugin-kit": "^0.2.0", "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/package.json b/package.json index c4379ae3..b5e32ce8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "css-loader": "^7.1.2", "cypress": "^13.15.0", "cypress-file-upload": "^5.0.8", - "eslint": "~9.12.0", + "eslint": "~9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-react": "^7.37.1", "fork-ts-checker-webpack-plugin": "^9.0.2", @@ -80,18 +80,15 @@ "lint": "npm-run-all lint:*", "lint-fix": "npm-run-all lint:*:fix", "lint-setup": "npm-run-all lint:*:setup", - "lint-setup-break-system-packages": "npm-run-all lint:*:setup-break-system-packages", "lint:js": "npm run prettier:check && npm run eslint", "lint:js:fix": "npm run eslint:fix && npm run prettier", "lint:ls": "ls-lint", "lint:po": "lint-po locale/*.po", "lint:po:setup": "pip install --upgrade lint-po", - "lint:po:setup-break-system-packages": "pip install --upgrade --break-system-packages lint-po ", "lint:sass": "stylelint 'src/**/*.scss' --config .stylelintrc.json", "lint:ts": "tsc", "lint:yaml": "yamllint .", "lint:yaml:setup": "pip install --upgrade yamllint", - "lint:yaml:setup-break-system-packages": "pip install --upgrade --break-system-packages yamllint", "prettier": "prettier --write 'src/**' 'config/**' 'cypress/**'", "prettier:check": "prettier -l 'src/**' 'config/**' 'cypress/**'", "sort-exports": "perl -i -pe 's/^export/import/' src/**/index.ts ; npm run prettier ; perl -i -pe 's/^import/export/' src/**/index.ts",