mirror of
https://github.com/Guake/guake.git
synced 2025-10-26 11:27:13 +00:00
93 lines
2.6 KiB
YAML
93 lines
2.6 KiB
YAML
# .github/workflows/ci.yml
|
|
|
|
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Get tag
|
|
id: tag
|
|
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Checkout the current branch
|
|
run: |
|
|
echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV
|
|
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
|
|
git fetch --unshallow --tags
|
|
git tag
|
|
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
|
|
echo "reattaching HEAD on master"
|
|
git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV
|
|
fi
|
|
|
|
sudo apt update -q
|
|
yes | sudo ./scripts/bootstrap-dev-debian.sh
|
|
./scripts/bootstrap-dev-pip.sh system
|
|
#sudo apt install --no-install-recommends -y xvfb gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-wnck-3.0 gobject-introspection libgirepository1.0-dev
|
|
|
|
export DISPLAY=:99.0
|
|
|
|
- name: Test with pytest
|
|
run: |
|
|
set -e
|
|
mkdir test-rtd
|
|
virtualenv test-rtd
|
|
. ./test-rtd/bin/activate
|
|
pip install -r requirements-dev.txt
|
|
|
|
# for dev
|
|
make dev-actions
|
|
pipenv run pip install pycairo pygobject platformdirs importlib_metadata
|
|
# check
|
|
make check
|
|
make build
|
|
make test-actions
|
|
# prepare for deployment
|
|
make generate-paths
|
|
rm -rf test-rtd
|
|
|
|
- uses: Thog/action-equals@v1
|
|
id: isLatest
|
|
with:
|
|
a: ${{ matrix.python-version }}
|
|
b: 3.9
|
|
|
|
- name: Store dists (Python 3.9)
|
|
if: steps.isLatest.outputs.result
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
|
|
release-test:
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/master'
|
|
needs:
|
|
- build
|
|
steps:
|
|
- name: Retrieve dists
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ./
|
|
- name: Publish distribution 📦 to Test PyPI
|
|
uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
verify_metadata: false
|
|
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
repository_url: https://test.pypi.org/legacy/
|