Skip to content

Flatpak support, round two #1102

Flatpak support, round two

Flatpak support, round two #1102

Workflow file for this run

name: MacOS Tests
on:
push:
branches:
- main
- "releases/**"
pull_request:
branches:
- main
- "releases/**"
# Restrict tests to the most recent commit.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_test_app:
name: Build Test Client
runs-on: macos-latest
defaults:
run:
shell: bash -el {0}
outputs:
matrix: ${{ steps.testGen.outputs.tests }}
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: env.yml
activate-environment: vpn
- name: Install build dependencies
run: |
./scripts/macos/conda_install_extras.sh
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
brew install ninja
- name: Install Qt6
run: |
wget https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/mozillavpn.v2.mozillavpn.cache.level-3.toolchains.v3.qt-mac.latest/artifacts/public%2Fbuild%2Fqt6_mac.zip -O qt6_mac.zip
unzip -a -d ${{ github.workspace }} qt6_mac.zip
- name: Compile test client
run: |
conda info --envs
which python
which python3
echo "!!!!!!!!!!"
mkdir -p build/cmake
cmake -S $(pwd) -B build/cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/qt_dist/lib/cmake
cmake --build build/cmake -j$(nproc) --target dummyvpn
cp ./build/cmake/tests/dummyvpn/dummyvpn build/
cp -r ./build/cmake/tests/dummyvpn/addons build/addons
- uses: actions/upload-artifact@v3
with:
name: test-client-${{ github.sha }}
path: |
build/
!build/cmake/
- name: Generate tasklist
id: testGen
run: |
echo -n "tests=" >> $GITHUB_OUTPUT
for test in $(find tests/functional -name 'test*.js' | sort); do
printf '{"name": "%s", "path": "%s"}' $(basename ${test%.js} | sed -n 's/test//p') $test
done | jq -s -c >> $GITHUB_OUTPUT
- name: Check tests
env:
TEST_LIST: ${{ steps.testGen.outputs.tests }}
run: |
echo $TEST_LIST | jq
functionaltests:
name: Functional tests
needs:
- build_test_app
runs-on: macos-latest
timeout-minutes: 45
strategy:
fail-fast: false # Don't cancel other jobs if a test fails
matrix:
test: ${{ fromJson(needs.build_test_app.outputs.matrix) }}
steps:
- name: Clone repository
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: test-client-${{ github.sha }}
path: build/
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install test dependecies
run: |
pip install -r requirements.txt
npm install
- name: Check build
shell: bash
run: |
chmod +x ./build/dummyvpn
./build/dummyvpn -v
- name: Running ${{ matrix.test.name }} Tests
id: runTests
uses: nick-invision/retry@v2
with:
timeout_minutes: 15
max_attempts: 3
command: |
export PATH=$GECKOWEBDRIVER:$(npm bin):$PATH
export HEADLESS=yes
export TZ=Europe/London
mkdir -p $ARTIFACT_DIR
npm run functionalTest -- --retries 3 ${{ matrix.test.path }}
env:
ARTIFACT_DIR: ${{ runner.temp }}/artifacts
MVPN_BIN: ./build/dummyvpn
- name: Uploading artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: ${{ matrix.test.name }} Logs
path: ${{ runner.temp }}/artifacts