Skip to content

Bump client/submodules/parsec-cloud from cb5cce5 to 7da7b3a #274

Bump client/submodules/parsec-cloud from cb5cce5 to 7da7b3a

Bump client/submodules/parsec-cloud from cb5cce5 to 7da7b3a #274

Workflow file for this run

name: CI
on:
push:
branches:
- master
- releases/*
pull_request:
branches:
- master
- releases/*
# 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-${{ 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-client
- linux-server
- windows-client
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-client:
name: 🐧 Linux client
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected] # [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', 'client/submodules/parsec-cloud/**') }}" >> $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@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin v3.3.2
id: restore
with:
key: ${{ steps.cache-key.outputs.key }}
path: /home/runner/.cache/pypoetry/virtualenvs/resana-secure-ZeXD18oj-py3.9
- name: Cache rust artifact
uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # pin v2.6.2
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@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin v3.3.2
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/[email protected] # [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@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin v3.3.2
with:
key: linux-server-2-${{ hashFiles('server/poetry.lock') }}
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-client:
name: 🏁 Windows client
runs-on: windows-latest
defaults:
run:
working-directory: client
steps:
- name: Checkout
uses: actions/[email protected] # [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@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin v3.3.2
with:
key: windows-build-${{ hashFiles('client/poetry.lock', 'client/submodules/parsec-cloud/**') }}
path: C:\Users\runneradmin\AppData\Local\pypoetry\Cache\virtualenvs\resana-secure-*
- name: Cache rust artifact
uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # pin v2.6.2
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