Skip to content
Merged
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.eslintrc.js
*.js
tests/localization/*
pnpm-lock.yaml
71 changes: 51 additions & 20 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,72 @@ jobs:
steps:
- run: git config --global core.autocrlf false

- name: Checkout git repo
uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref }}
submodules: 'recursive'
lfs: true

- name: Install node
uses: actions/setup-node@v4
- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4

- name: Enable long paths (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: git config --system core.longpaths true

- name: Setup pnpm hoisted node-linker (Windows Only)
if: runner.os == 'Windows'
shell: bash
run: pnpm config set node-linker hoisted

- name: Setup node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
cache-dependency-path: 'pnpm-lock.yaml'

- uses: actions/cache/restore@v4
id: cache-playwright-modules
- name: Cache .electron-gyp
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

- name: Install dependencies
shell: bash
if: steps.cache-playwright-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
path: ~/.electron-gyp
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- uses: actions/cache/save@v4
id: cache-playwright-modules-save
- name: Restore cached .eslintcache and tsconfig.tsbuildinfo
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
id: cache-lint
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
path: |
.eslintcache
tsconfig.tsbuildinfo
key: lint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**', '.eslintrc.js', '.eslint/**', 'tsconfig.json') }}

- name: Install node_modules
shell: bash
run: pnpm install
env:
NPM_CONFIG_LOGLEVEL: verbose

- name: Lint Files
run: yarn lint-check
shell: bash
run: pnpm run lint-check

- run: git diff --exit-code

- name: Update cached .eslintcache and tsconfig.tsbuildinfo
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
if: github.ref == 'refs/heads/main'
with:
path: |
.eslintcache
tsconfig.tsbuildinfo
key: ${{ steps.cache-lint.outputs.cache-primary-key }}

- name: Compile typescript files
shell: bash
run: yarn tsc
run: pnpm tsc

- name: Run the only test we can without a browser
shell: bash
run: PRINT_FAILED_TEST_LOGS=1 npx playwright test -g "Enforce localized strings return expected values"
run: PRINT_FAILED_TEST_LOGS=1 pnpm playwright test -g "Enforce localized strings return expected values"
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.eslintrc.js
README.md
tests/localization/*.ts
tests/localization/*
tests/localization/*
pnpm-lock.yaml
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Once nvm is installed, install the node version declared in the `.nvmrc` file:
- `nvm install` on linux/macos
- `nvm install <specific version from the .nvmrc>` on windows

Install yarn & dependencies:
- `npm install -g yarn`
- `yarn install --frozen-lockfile`
Install [pnpm](https://pnpm.io/installation):
You can install it by running `npm install --global pnpm`, but you should read the [installation instructions](https://pnpm.io/installation) as other methods are better.

Install dependencies:
- `pnpm install`

## Config

Expand Down Expand Up @@ -47,7 +49,7 @@ Create your own config from the `.env.sample` and edit the values to match your
## Test run

To run a specific test, or tests matching a string you can do so with
`yarn test -g "<string to match>"`.
`pnpm test -g "<string to match>"`.

To run all the test suite, just do
`yarn test`.
`pnpm test`.
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default tseslint.config(
{
ignores: [
'**/node_modules/**',
'.yarn/',
'eslint.config.mjs',
'run/**/*.js',
'avd/',
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"name": "session-playwright",
"packageManager": "pnpm@10.28.1",
"version": "1.0.0",
"main": "index.js",
"repository": "git@github.com:session-foundation/session-playwright.git",
"author": "Audric Ackermann <audric@loki.network>",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.51",
"@playwright/test": "^1.57.0",
"@types/fs-extra": "^11.0.1",
"@types/lodash": "^4.14.196",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.0.0",
"allure-commandline": "^2.23.1",
"allure-playwright": "2.6.0",
"chalk": "4.1.2",
"dotenv": "^16.4.5",
"electron": "34.2.0",
"electron": "40.0.0",
"eslint": "^8.46.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
Expand All @@ -26,21 +28,21 @@
"eslint-plugin-perfectionist": "^4.15.0",
"fs-extra": "^11.1.1",
"lodash": "^4.17.21",
"playwright": "^1.57.0",
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"uuid": "^9.0.1"
},
"scripts": {
"build": "yarn tsc --watch",
"lint": "yarn prettier . --write --cache && yarn eslint .",
"lint-check": "yarn prettier . --check && yarn eslint .",
"dev": "yarn tsc --watch",
"test": "npx playwright test",
"build": "pnpm tsc --watch",
"lint": "pnpm prettier . --write --cache && pnpm eslint .",
"lint-check": "pnpm prettier . --check && pnpm eslint .",
"dev": "pnpm tsc --watch",
"test": "playwright test",
"test-rerun": "PLAYWRIGHT_WORKERS_COUNT=1 PRINT_FAILED_TEST_LOGS=1 npx playwright test --last-failed",
"watch": "tsc -w",
"sync": "./sync-localization.sh",
"allure-create": "allure generate ./allure-results",
"allure-open": "allure open ./allure-report"
},
"dependencies": {}
}
}
Loading