generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (155 loc) · 6.99 KB
/
end-to-end-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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Run End-to-End Tests
on:
workflow_dispatch:
schedule:
# every night, at 2:30
- cron: '30 2 * * *'
push:
jobs:
e2e-test-matrix:
name: Run End-to-End tests for ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
runHttpApi: |
cd "${RAD_HOME}"/bin
wget -q -O rha.tar.xz https://minio-api.radicle.gr/radicle-releases/radicle-http-api/radicle-http-api_latest+x86_64-unknown-linux-musl.tar.xz
# now there will be radicle-http-api inside bin directory, which is in path
tar xf rha.tar.xz --strip-components 2
runIde: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x24 &
sleep 10
mkdir -p build/reports
ls -alh ${RADICLE_REPO}
echo "Opening ${RADICLE_REPO} in IDE..."
./gradlew :runIdeForUiTests > build/reports/idea.log &
runTests: |
export DISPLAY=:99.0
./gradlew :endToEndTests
- os: macos-latest
runHttpApi: |
cd "${RAD_HOME}"/bin
wget -q -O rha.tar.xz https://minio-api.radicle.gr/radicle-releases/radicle-http-api/radicle-http-api_latest+aarch64-apple-darwin.tar.xz
# now there will be radicle-http-api inside bin directory, which is in path
tar xf rha.tar.xz --strip-components 2
runIde: |
mkdir -p build/reports
ls -alh ${RADICLE_REPO}
echo "Opening ${RADICLE_REPO} in IDE..."
./gradlew :runIdeForUiTests > build/reports/idea.log &
runTests: |
./gradlew :endToEndTests
runs-on: ${{ matrix.os }}
steps:
- name: Install Radicle
env:
RAD_HOME: ${{ github.workspace }}/.radicle
run: |
curl -sSf https://radicle.xyz/install | sh
echo "${RAD_HOME}/bin" >> $GITHUB_PATH
echo "RAD_HOME=${{ github.workspace }}/.radicle" >> $GITHUB_ENV
- name: Install radicle-http-api
run: ${{ matrix.runHttpApi }}
- name: Create New Radicle Identity
run: |
RAD_PASSPHRASE="" rad auth --alias test_user
- name: Configure Radicle Node
run: |
# Source: https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/tree/HACKING.md
jq '.node.network = "test" | .preferredSeeds = [] | .node.connect = [] | .node.peers.type = "static"' ${RAD_HOME}/config.json > ${RAD_HOME}/config.json.tmp
mv ${RAD_HOME}/config.json.tmp ${RAD_HOME}/config.json
- name: Start Radicle Node and http API
run: |
rad --version
rad node start
echo "allowing node to start up..."
sleep 5
radicle-http-api --version
radicle-http-api --listen 0.0.0.0:8080 &
rad node status
rad self
- name: Create a new Radicle Repository
id: radicle-init
run: |
mkdir ${{ github.workspace }}/a_blog
cd ${{ github.workspace }}/a_blog
git config --global init.defaultBranch main
git init .
git config --local user.email "[email protected]"
git config --local user.name "Radicle Test"
echo "# A Blog" > README.md
git add README.md
git commit -m 'adds readme'
rad init --public --default-branch main --name "a-test-blog" --description "Some repo" --no-confirm --verbose
pwd
cd ..
chmod -R 777 a_blog
echo "RADICLE_REPO=${{ github.workspace }}/a_blog" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/radicle-jetbrains-plugin
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 21
- name: Setup FFmpeg
if: ${{matrix.os == 'ubuntu-latest'}}
uses: FedericoCarboni/setup-ffmpeg@v3
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup FFmpeg mac
if: ${{matrix.os == 'macos-latest'}}
run: brew install ffmpeg
- name: env
if: runner.os != 'Windows'
run: |
echo "JDK_JAVA_OPTIONS=--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens java.xml/javax.xml.transform=ALL-UNNAMED --add-exports java.desktop/sun.awt.image=ALL-UNNAMED" >> $GITHUB_ENV
- name: env on Windows
if: runner.os == 'Windows'
run: echo "JDK_JAVA_OPTIONS=--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens java.xml/javax.xml.transform=ALL-UNNAMED --add-exports java.desktop/sun.awt.image=ALL-UNNAMED" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Clean
working-directory: ${{ github.workspace }}/radicle-jetbrains-plugin
run: ./gradlew :clean
- name: Run Idea
env:
RADICLE_REPO: ${{ github.workspace }}/a_blog
working-directory: ${{ github.workspace }}/radicle-jetbrains-plugin
run: ${{ matrix.runIde }}
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v4
with:
url: http://127.0.0.1:8082
max-attempts: 15
retry-delay: 30s
- name: Tests
env:
RADICLE_REPO: ${{ github.workspace }}/a_blog
PROJECT_PATH: ${{ github.workspace }}/a_blog
RAD_PATH: ${{ github.workspace }}/.radicle/bin/rad
working-directory: ${{ github.workspace }}/radicle-jetbrains-plugin
run: ${{ matrix.runTests }}
- name: Move video
if: ${{ failure() }}
working-directory: ${{ github.workspace }}/radicle-jetbrains-plugin
run: mv video/ build/reports/
- name: Copy logs
if: ${{ failure() }}
working-directory: ${{ github.workspace }}/radicle-jetbrains-plugin
run: |
# make a loop to iterate over the wildcard in the directory, as we don't want to hardcode the ij version
for f in ./build/idea-sandbox/*/log/idea.log; do
cp "$f" ./build/reports/idea.log
done
- name: Save fails report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: e2e-test-fails-report-${{ matrix.os }}
path: |
${{ github.workspace }}/radicle-jetbrains-plugin/build/reports