Consolidate Build & Test CI (#32929)
* Consolidate Build & Test CI * Add missing workflow dependency * Fix artifact name clash * Fix playwright config * Fix playwright_ew job * Fix ed tests * Fix playwright tags * Iterate * Fix file reads * Fix sample-files paths * Fix PW_TAG * Fix blob report paths * Delint * Fix build-and-test.yaml * Iterate * Fix consentHomeserver.ts * Simplify * Iterate * Delint * Iterate * Iterate * Iterate * Specify shell * Simplify * Delete apps/web/playwright/sample-files/index.ts * Discard changes to apps/web/playwright/sample-files/index.ts * Exclude playwright-common from coverage gate * Attempt to speed up arm64 desktop test * Revert "Attempt to speed up arm64 desktop test" This reverts commit 8fa8ff0c785da6dad05bda938c8af24fa6af0451. * Iterate * Fix cache key * Accept python or python3 as per node-gyp * Accept python or python3 as per node-gypd * Exclude apps/desktop/hak from coverage gate
This commit is contained in:
committed by
GitHub
parent
cabac4ef0e
commit
2b3720b4a2
@@ -14,10 +14,7 @@ import type { Tool } from "../../scripts/hak/hakEnv.ts";
|
||||
import type { DependencyInfo } from "../../scripts/hak/dep.ts";
|
||||
|
||||
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
const tools: Tool[] = [
|
||||
["rustc", "--version"],
|
||||
["python", "--version"], // node-gyp uses python for reasons beyond comprehension
|
||||
];
|
||||
const tools: Tool[] = [["rustc", "--version"]];
|
||||
if (hakEnv.isWin()) {
|
||||
tools.push(["perl", "--version"]); // for openssl configure
|
||||
tools.push(["nasm", "-v"]); // for openssl building
|
||||
@@ -28,6 +25,14 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
|
||||
}
|
||||
await hakEnv.checkTools(tools);
|
||||
|
||||
try {
|
||||
// node-gyp uses python for reasons beyond comprehension
|
||||
await hakEnv.checkTools([["python", "--version"]]);
|
||||
} catch {
|
||||
// try python3 too
|
||||
await hakEnv.checkTools([["python3", "--version"]]);
|
||||
}
|
||||
|
||||
// Ensure Rust target exists (nb. we avoid depending on rustup)
|
||||
await new Promise((resolve, reject) => {
|
||||
const rustc = childProcess.execFile(
|
||||
|
||||
@@ -8,25 +8,9 @@ Please see LICENSE files in the repository root for full details.
|
||||
|
||||
import { defineConfig } from "@playwright/test";
|
||||
|
||||
const projects = [
|
||||
"macos",
|
||||
"win-x64",
|
||||
"win-ia32",
|
||||
"win-arm64",
|
||||
"linux-amd64-sqlcipher-system",
|
||||
"linux-amd64-sqlcipher-static",
|
||||
"linux-arm64-sqlcipher-system",
|
||||
"linux-arm64-sqlcipher-static",
|
||||
];
|
||||
|
||||
export default defineConfig({
|
||||
// Allows the GitHub action to specify a project name (OS + arch) for the combined report to make sense
|
||||
// workaround for https://github.com/microsoft/playwright/issues/33521
|
||||
projects: process.env.CI
|
||||
? projects.map((name) => ({
|
||||
name,
|
||||
}))
|
||||
: undefined,
|
||||
projects: [{ name: "Desktop" }],
|
||||
tag: process.env.PW_TAG ? `@${process.env.PW_TAG}` : undefined,
|
||||
use: {
|
||||
viewport: { width: 1280, height: 720 },
|
||||
video: "retain-on-failure",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "app",
|
||||
"projectType": "application",
|
||||
"implicitDependencies": ["element-web"],
|
||||
"root": "apps/desktop",
|
||||
"targets": {
|
||||
"docker:build": {
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script for downloading a branch of element-web matching the branch a PR is contributed from
|
||||
|
||||
set -x
|
||||
|
||||
deforg="element-hq"
|
||||
defrepo="element-web"
|
||||
|
||||
# The PR_NUMBER variable must be set explicitly.
|
||||
default_org_repo=${GITHUB_REPOSITORY:-"$deforg/$defrepo"}
|
||||
PR_ORG=${PR_ORG:-${default_org_repo%%/*}}
|
||||
PR_REPO=${PR_REPO:-${default_org_repo##*/}}
|
||||
|
||||
# A function that clones a branch of a repo based on the org, repo and branch
|
||||
clone() {
|
||||
org=$1
|
||||
repo=$2
|
||||
branch=$3
|
||||
if [ -n "$branch" ]
|
||||
then
|
||||
echo "Trying to use $org/$repo#$branch"
|
||||
# Disable auth prompts: https://serverfault.com/a/665959
|
||||
GIT_TERMINAL_PROMPT=0 git clone https://github.com/$org/$repo.git $repo --branch "$branch" --depth 1 && exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Getting info about a PR with number $PR_NUMBER"
|
||||
apiEndpoint="https://api.github.com/repos/$PR_ORG/$PR_REPO/pulls/$PR_NUMBER"
|
||||
head=$(curl "$apiEndpoint" | jq -r '.head.label')
|
||||
|
||||
# for forks, $head will be in the format "fork:branch", so we split it by ":"
|
||||
# into an array. On non-forks, this has the effect of splitting into a single
|
||||
# element array given ":" shouldn't appear in the head - it'll just be the
|
||||
# branch name. Based on the results, we clone.
|
||||
BRANCH_ARRAY=(${head//:/ })
|
||||
TRY_ORG=$deforg
|
||||
TRY_BRANCH=${BRANCH_ARRAY[0]}
|
||||
if [[ "$head" == *":"* ]]; then
|
||||
# ... but only match that fork if it's a real fork
|
||||
if [ "${BRANCH_ARRAY[0]}" != "$PR_ORG" ]; then
|
||||
TRY_ORG=${BRANCH_ARRAY[0]}
|
||||
fi
|
||||
TRY_BRANCH=${BRANCH_ARRAY[1]}
|
||||
fi
|
||||
clone "$TRY_ORG" "$defrepo" "$TRY_BRANCH"
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user