Skip to content

Bump client/submodules/parsec-cloud from 62bd597 to 2f2624a #779

Bump client/submodules/parsec-cloud from 62bd597 to 2f2624a

Bump client/submodules/parsec-cloud from 62bd597 to 2f2624a #779

Workflow file for this run

name: CI build
on:
push:
branches:
- master
- "[0-9]+.[0-9]+"
pull_request:
branches:
- master
# Global Settings
env:
PYTHON_VERSION: "3.9"
# TODO: cannot update to 1.4 yet, see https://github.com/python-poetry/poetry/issues/7611
POETRY_VERSION: 1.3.2
WINFSP_VERSION: 1.8.20304
FORCE_MATURIN_RELEASE: 1
PYTEST_ARGS: >-
--numprocesses=auto
--verbose
concurrency:
group: ci-build-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Github PR merging is configured to only require this job to pass
ci-is-happy:
name: ⭐ CI is happy ⭐
needs:
- linux-check-test-build-client
- linux-server
- windows-build
- windows-packaging
runs-on: ubuntu-latest
if: always()
# Just a fail-safe timeout, see the fine grain per-task timeout instead
timeout-minutes: 2
steps:
# The Needs context value contains only:
# - the final state of a job (if it fails or not)
# - its output (currently, none of our jobs are configuring outputs variable)
#
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
- name: Debug the needs context values
env:
NEEDS: ${{ toJSON(needs) }}
run: printenv NEEDS
- name: We're very sorry
run: |
echo "Oh No, we have jobs that have failed/cancelled/skipped :("
exit 21
if: >-
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'skipped')
|| contains(needs.*.result, 'cancelled')
|| ! contains(needs.*.result, 'success')
- name: It's showtime
run: echo "My job here is done !"
#################################
# Linux #
#################################
linux-check-test-build-client:
name: 🐧 Linux check, test & build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3 # [email protected]
with:
submodules: true
- name: Install fuse
run: sudo apt-get install -y libfuse2
- name: Install poetry-${{ env.POETRY_VERSION }}
shell: bash
run: |
set -eux
set -o pipefail
export POETRY_HOME="$HOME/.poetry"
mkdir -p "$POETRY_HOME"
if ! curl -sSL https://install.python-poetry.org | python3 - --version=${{ env.POETRY_VERSION }}; then
tail -n +0 ${{ github.workspace }}/poetry-installer*.log
exit 3
fi
echo "$POETRY_HOME/bin" >> "$GITHUB_PATH"
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Configure poetry to use the installed python
shell: bash
run: poetry env use ${{ steps.setup-python.outputs.python-path }}
working-directory: client
- name: Debug python & poetry versions
run: |
python --version
poetry --version
poetry env info
working-directory: client
- name: Generate cache key
id: cache-key
run: |
echo "key=linux-client-2-${{ hashFiles('client/poetry.lock') }}" >> $GITHUB_OUTPUT
echo "restore-keys=linux-client-2-" >> $GITHUB_OUTPUT
# Using this workaround to cache `poetry` dependencies until
# https://github.com/actions/setup-python/issues/476 is resolved
- name: Restore python dependencies
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin v3.3.1
id: restore
with:
key: ${{ steps.cache-key.outputs.key }}
restore-keys: ${{ steps.cache-key.outputs.restore-keys }}
path: /home/runner/.cache/pypoetry/virtualenvs/resana-secure-ZeXD18oj-py3.9
- name: Cache rust artifact
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # pin v2.5.1
with:
workspaces: client/submodules/parsec-cloud -> target
cache-targets: true
cache-all-crates: true
- name: Install Project
run: poetry install -v
working-directory: client
- name: Verify poetry lock is up to date with submodule dependency parsec-cloud
run: |
set -o pipefail -e
POETRY_PARSEC_VERSION=$(poetry show parsec-cloud | sed -n 's/^\s\+version\s\+: \(v\S\+\)\s\+$/\1/p')
SUBMOD_PARSEC_VERSION=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' submodules/parsec-cloud/parsec/_version.py)
if [ -z "$POETRY_PARSEC_VERSION" ]; then
echo "Empty poetry version" >&2
exit 1
fi
if [ -z "$SUBMOD_PARSEC_VERSION" ]; then
echo "Empty submodule version" >&2
exit 1
fi
if [ "$POETRY_PARSEC_VERSION" != "$SUBMOD_PARSEC_VERSION" ]; then
(
echo "The versions between poetry and submodule don't match (\`$POETRY_PARSEC_VERSION\` != \`$SUBMOD_PARSEC_VERSION\`)"
echo "This is likely because someone forgot to update \`poetry.lock\` file"
echo "To update \`poetry.lock\` use:"
echo
echo "\`poetry lock --no-update\`"
) >&2
exit 1
fi
working-directory: client
- name: Check fuse
run: poetry run python -c "import fuse"
working-directory: client
- name: Run Tests
run: poetry run py.test client_tests ${{ env.PYTEST_ARGS }}
timeout-minutes: 10
working-directory: client
# Using this workaround to cache `poetry` dependencies until
# https://github.com/actions/setup-python/issues/476 is resolved
- name: Save python dependencies before `pre-commit`
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin v3.3.1
if: steps.restore.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-key.outputs.key }}
path: /home/runner/.cache/pypoetry/virtualenvs/resana-secure-ZeXD18oj-py3.9
- name: "[Quality] Run pre-commit with mypy-client"
uses: pre-commit/[email protected]
linux-server:
name: 🐧 Linux server
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- name: Checkout
uses: actions/checkout@v3 # [email protected]
with:
submodules: true
- name: Install poetry-${{ env.POETRY_VERSION }}
shell: bash
run: |
set -eux
set -o pipefail
export POETRY_HOME="$HOME/.poetry"
mkdir -p "$POETRY_HOME"
if ! curl -sSL https://install.python-poetry.org | python3 - --version=${{ env.POETRY_VERSION }}; then
tail -n +0 ${{ github.workspace }}/poetry-installer*.log
exit 3
fi
echo "$POETRY_HOME/bin" >> "$GITHUB_PATH"
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Configure poetry to use the installed python
shell: bash
run: poetry env use ${{ steps.setup-python.outputs.python-path }}
- name: Debug python & poetry versions
run: |
python --version
poetry --version
poetry env info
# Using this workaround to cache `poetry` dependencies until
# https://github.com/actions/setup-python/issues/476 is resolved
- name: Cache python dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin v3.3.1
with:
key: linux-server-2-${{ hashFiles('server/poetry.lock') }}
restore-keys: linux-server-2-
path: /home/runner/.cache/pypoetry/virtualenvs/resana-server-OVnVNowq-py3.9
- name: Install Project
run: poetry install -v
- name: Run Tests
run: poetry run py.test server_tests ${{ env.PYTEST_ARGS }}
timeout-minutes: 10
#################################
# Windows #
#################################
windows-build:
name: 🏁 Windows build
runs-on: windows-latest
defaults:
run:
working-directory: client
steps:
- name: Checkout
uses: actions/checkout@v3 # [email protected]
with:
submodules: true
- name: Install poetry-${{ env.POETRY_VERSION }}
shell: bash
run: |
set -eux
export POETRY_HOME=${APPDATA}/.poetry
curl -sSL https://install.python-poetry.org \
| python3 - --version=${{ env.POETRY_VERSION }}
echo "${APPDATA}\.poetry\bin" >> "$GITHUB_PATH"
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Configure poetry to use the installed python
shell: pwsh
run: poetry env use ${{ steps.setup-python.outputs.python-path }}
- name: Debug python & poetry versions
shell: bash
run: |
python --version
poetry --version
poetry env info
- name: Install WinFSP
shell: bash
run: |
set -eux
choco install -y --limit-output winfsp --version=${{ env.WINFSP_VERSION }}
# Using this workaround to cache `poetry` dependencies until
# https://github.com/actions/setup-python/issues/476 is resolved
- name: Cache python dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin v3.3.1
with:
key: windows-build-${{ hashFiles('client/poetry.lock') }}
restore-keys: windows-build-
path: C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\resana-secure-*
- name: Cache rust artifact
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # pin v2.5.1
with:
workspaces: client/submodules/parsec-cloud -> target
cache-targets: true
cache-all-crates: true
- name: Install project
run: poetry install -v
- name: Run tests
run: poetry run py.test client_tests ${{ env.PYTEST_ARGS }}
timeout-minutes: 10
windows-packaging:
name: 🏁 Windows packaging
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3 # [email protected]
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
# Using this workaround to cache `poetry` dependencies until
# https://github.com/actions/setup-python/issues/476 is resolved
# Here we restore only since we use the same dependencies has `windows-build`
- name: Restore cache from `windows-build`
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin v3.3.1
with:
key: windows-packaging-${{ hashFiles('client/poetry.lock') }}
restore-keys: windows-packaging-
path: |
packaging/windows/build/tools_venv
packaging/windows/build/pyinstaller_venv
# Building OpenSSL requires a perl interpreter.
# The default one does not provide windows-style filesystem
# paths so we have to switch to Strawberry.
- name: Use strawberry perl
shell: bash
run: echo OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl >> $GITHUB_ENV
timeout-minutes: 1
- name: Freeze Parsec
run: python freeze_program.py ../../client
working-directory: packaging/windows/
- name: Upload installer as artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin v3.1.2
with:
name: ${{ runner.os }}-${{ runner.arch }}-installer-content
path: |
packaging/windows/build/manifest.ini
packaging/windows/build/install_files.nsh
packaging/windows/build/uninstall_files.nsh
packaging/windows/build/resana_secure-*/
packaging/windows/build/winfsp-*