Merge pull request #872 from badsyntax/actions-retry

Actions retry
This commit is contained in:
Richard Willis 2021-03-07 17:36:19 +00:00 коммит произвёл GitHub
Родитель 9c16c8d58a 6578d1f221
Коммит 0efa402cbf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 57 добавлений и 25 удалений

64
.github/workflows/main.yml поставляемый
Просмотреть файл

@ -10,7 +10,7 @@ on:
jobs:
build-and-analyse:
name: Build & Analyse
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
@ -78,8 +78,7 @@ jobs:
matrix:
node-version: [14.15.4]
java-version: ["8", "11", "15"]
os: [ubuntu-latest, windows-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-20.04, windows-2019, macos-10.15]
steps:
- uses: actions/checkout@v2
- name: Use Node ${{ matrix.node-version }}
@ -114,12 +113,12 @@ jobs:
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
- name: Set permissions
run: |
chmod +x extension/lib/gradle-server
unset npm_config_prefix
if: matrix.os != 'windows-latest'
if: matrix.os != 'windows-2019'
- name: Prepare gradle-groovy-custom-build-file
uses: eskatos/gradle-command-action@v1
with:
@ -143,12 +142,43 @@ jobs:
wrapper-cache-enabled: false
- name: Test extension
uses: eskatos/gradle-command-action@v1
continue-on-error: true
id: test
with:
arguments: testVsCode
wrapper-cache-enabled: false
env:
DISPLAY: ":99.0"
CI: "true"
- name: Retry test extension attempt 1
uses: eskatos/gradle-command-action@v1
continue-on-error: true
if: steps.test.outcome=='failure'
id: retry1
with:
arguments: testVsCode
wrapper-cache-enabled: false
env:
DISPLAY: ":99.0"
CI: "true"
- name: Retry test extension attempt 2
uses: eskatos/gradle-command-action@v1
continue-on-error: true
if: steps.retry1.outcome=='failure'
id: retry2
with:
arguments: testVsCode
wrapper-cache-enabled: false
env:
DISPLAY: ":99.0"
CI: "true"
- name: Set test extension status
if: ${{ steps.test.outcome=='failure' || steps.retry1.outcome=='failure' || steps.retry2.outcome=='failure' }}
run: |
echo "Tests failed"
exit 1
- name: Stop Gradle daemon for root project
uses: eskatos/gradle-command-action@v1
with:
@ -179,7 +209,7 @@ jobs:
publish-beta-extension:
needs: [test-extension]
name: Publish BETA extension
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: github.event_name == 'push' && contains(github.ref, '/release/')
steps:
- uses: actions/checkout@v2
@ -215,7 +245,7 @@ jobs:
publish-extension:
needs: [test-extension]
name: Publish extension
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v2
@ -244,16 +274,6 @@ jobs:
with:
arguments: prepareForRelease --no-daemon
wrapper-cache-enabled: false
- name: Publish types
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd npm-package
tag=${GITHUB_REF#refs/tags/}
echo "Setting package version $tag"
npm --no-git-tag-version version "$tag"
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
npm publish
- name: Publish extension
env:
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
@ -265,3 +285,13 @@ jobs:
npm --no-git-tag-version version "$tag"
npx vsce publish -p "$AZURE_TOKEN"
npx ovsx publish -p "$OPENVSX_TOKEN"
- name: Publish types
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd npm-package
tag=${GITHUB_REF#refs/tags/}
echo "Setting package version $tag"
npm --no-git-tag-version version "$tag"
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
npm publish

Просмотреть файл

@ -10,7 +10,10 @@ Start by opening an issue using one of the issue templates, or propose a change
2. Install [Java version >= 8](https://adoptopenjdk.net/)
3. Change directory to the root of the project
4. Select Node version: `nvm use`
5. Build project files: `./gradlew build`
5. If using an Apple M1:
- Add `npm_arch=x64` to $HOME/.gradle/gradle.properties
- Add `protoc_platform=osx-x86_64` to $HOME/.gradle/gradle.properties
6. Build project files: `./gradlew build`
Running the build for the first time can take a bit of time, but subsequent builds should be fast.

Просмотреть файл

@ -15,10 +15,11 @@
"rules": {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "error"
"@typescript-eslint/no-floating-promises": "error",
"no-unused-vars": "off",
"no-console": "warn"
},
"overrides": [
{

Просмотреть файл

@ -336,7 +336,6 @@ export class GradleClient implements vscode.Disposable {
try {
const reply: CancelBuildReply | undefined = await new Promise(
(resolve, reject) => {
console.log('cancel build');
this.grpcClient!.cancelBuild(
request,
(

Просмотреть файл

@ -45,7 +45,6 @@ export class GradleRunnerTerminal implements vscode.Pseudoterminal {
public async close(): Promise<void> {
if (this.task && isTaskRunning(this.task)) {
console.log('foo');
await this.cancelCommand();
}
}

Просмотреть файл

@ -86,7 +86,7 @@ public class GetBuildHandler {
try (ProjectConnection connection = gradleConnector.connect()) {
replyWithBuildEnvironment(buildEnvironment(connection));
org.gradle.tooling.model.GradleProject gradleProject = buildGradleProject(connection);
org.gradle.tooling.model.GradleProject gradleProject = getGradleProject(connection);
replyWithProject(getProjectData(gradleProject, gradleProject));
} catch (BuildCancelledException e) {
replyWithCancelled(e);
@ -135,7 +135,7 @@ public class GetBuildHandler {
}
}
private org.gradle.tooling.model.GradleProject buildGradleProject(ProjectConnection connection)
private org.gradle.tooling.model.GradleProject getGradleProject(ProjectConnection connection)
throws IOException {
ModelBuilder<org.gradle.tooling.model.GradleProject> projectBuilder =

2
gradle/wrapper/gradle-wrapper.properties поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists