Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First implementation #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

KuznetsovRoman
Copy link
Member

No description provided.

Copy link

github-actions bot commented Jan 16, 2025

Testplane run finisned

Testplane HTML-report is available at https://gemini-testing.github.io/gh-actions-testplane/testplane-reports/2025-01-27/12980623276/36

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-389.action branch 29 times, most recently from a3354f1 to a32aff2 Compare January 21, 2025 19:46
@@ -0,0 +1,41 @@
name: GitHub action publish new version
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Флоу для релиза новой версии github action
Собирает новую версию action и коммитит ее в мастер

@@ -0,0 +1,65 @@
name: Testplane CI
Copy link
Member Author

@KuznetsovRoman KuznetsovRoman Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестовый флоу.

  • Тестирует юнит тестами
  • Прогоняет линтер
  • Билдит action
  • Запускает этот action на тестовом проекте
  • Выкладывает html-отчет на gh-pages
  • Оставляет комментарий со ссылкой на отчет

@@ -1 +1,2 @@
node_modules
dist/dev.js
Copy link
Member Author

@KuznetsovRoman KuznetsovRoman Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Собирается с npm run build, запускается разработчиком
На самом деле, локально билдить какого-то смысла нет, кроме как "проверить, что оно собирается"

@@ -0,0 +1 @@
v20.18.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Максимальная версия, поддерживаемая github actions

@@ -0,0 +1,43 @@
name: 'Testplane action'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Конфиг github action
Описывает входные и выходные параметры

return;
}

if (this.needsBrowsersCache && !cache.isFeatureAvailable()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh сервис кэширования может быть недоступен


core.debug(`Testplane browsers cache primary key: "${this.cachePrimaryKey}"`);

this.init = () => Promise.resolve();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Второй раз init не нужен

const commandOutput = await this.pm.getExecOutput(this.withConfig(["testplane", "--version"]));
const semverNumbers = commandOutput.split(".").map(Number) as [MajorVersion, MinorVersion, PatchVersion];

this.version = () => Promise.resolve(semverNumbers);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Результаты подобных команд не изменяются в процессе работы action, так что их кэшируем


core.debug("Running Testplane install-deps");

await this.pm.exec(this.withConfig(["testplane", "install-deps"]), { silent: false });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

silent: false включает вывод логов команды в stdout/stderr

const dateNow = new Date();

const year = dateNow.getUTCFullYear();
const month = String(dateNow.getUTCMonth() + 1).padStart(2, "0");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По умолчанию getUTCMonth выдает значения [0, 11]

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-389.action branch 2 times, most recently from 45a2e7d to 431cf70 Compare January 21, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant