forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 3
115 lines (102 loc) · 4.01 KB
/
code_completion_plugin_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# The workflow is triggered on the following events:
# - pull requests that contain changes in plugins/beam-code-completion-plugin/ directory
# - pushes to any branch except master. the push must contain changes in plugins/beam-code-completion-plugin/ directory
# To learn more about GitHub Actions in Apache Beam check the CI.md
name: Code Completion Plugin Tests
on:
push:
branches-ignore:
- 'master'
paths:
- 'plugins/beam-code-completion-plugin/**'
- '.github/workflows/code_completion_plugin_tests.yml'
pull_request:
paths:
- 'plugins/beam-code-completion-plugin/**'
- '.github/workflows/code_completion_plugin_tests.yml'
env:
INTELLIJ_IDEA_SOURCES: /home/runner/work/beam/beam/intellij
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
# Build plugin and provide the artifact for the next workflow jobs
test:
name: Build and run model-level tests
runs-on: ubuntu-latest
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out beam repository
- name: Fetch beam Sources
uses: actions/checkout@v4
with:
path: main
# Check out intellij community repository for tests
- name: Fetch intellij-community Sources
uses: actions/checkout@v4
with:
repository: JetBrains/intellij-community
path: intellij
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/[email protected]
# Setup Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
pwd
cd main/plugins/beam-code-completion-plugin/
pwd
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^name:" | cut -f2- -d ' ')"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Run tests
- name: Run Tests
run: |
pwd
cd main/plugins/beam-code-completion-plugin/
pwd
./gradlew test --info
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests