Skip to content

build: upload plugin and native libs to draft release as assets. #975

build: upload plugin and native libs to draft release as assets.

build: upload plugin and native libs to draft release as assets. #975

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