initial aur tester
This commit is contained in:
parent
6fe5b8e26a
commit
54914683ec
@ -4,7 +4,14 @@ version: 2.1
|
|||||||
orbs:
|
orbs:
|
||||||
python: circleci/python@2.1.1
|
python: circleci/python@2.1.1
|
||||||
|
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
|
archlinux:
|
||||||
|
docker:
|
||||||
|
- image: archlinux:base-devel
|
||||||
|
resource_class: small
|
||||||
|
working_directory: /
|
||||||
|
|
||||||
python:
|
python:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/python:3.11
|
- image: cimg/python:3.11
|
||||||
@ -16,30 +23,113 @@ executors:
|
|||||||
resource_class: medium
|
resource_class: medium
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
commands:
|
||||||
python-test:
|
archlinux-run:
|
||||||
executor: python
|
description: execute command steps in the archlinux container from the CI user
|
||||||
working_directory: ~/scwrypts/py/lib
|
parameters:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
command:
|
||||||
|
type: string
|
||||||
|
working_directory:
|
||||||
|
type: string
|
||||||
|
default: /home/ci
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
|
||||||
path: ~/scwrypts
|
|
||||||
- run:
|
- run:
|
||||||
name: pytest
|
name: << parameters.name >>
|
||||||
|
working_directory: << parameters.working_directory >>
|
||||||
|
command: su ci -c '<< parameters.command >>'
|
||||||
|
|
||||||
|
custom:
|
||||||
|
generic:
|
||||||
|
require-semver-tag:
|
||||||
|
- &generic_require_semver_tag
|
||||||
|
run:
|
||||||
|
name: check CIRCLE_TAG for full semantic version
|
||||||
command: |
|
command: |
|
||||||
: \
|
: \
|
||||||
&& pip install . .[test] \
|
&& [ $CIRCLE_TAG ] \
|
||||||
&& pytest \
|
&& [[ $CIRCLE_TAG =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] \
|
||||||
;
|
;
|
||||||
- run: pip install build && python -m build
|
|
||||||
|
|
||||||
python-publish:
|
archlinux:
|
||||||
executor: python
|
prepare:
|
||||||
working_directory: ~/scwrypts/py/lib
|
- &archlinux_prepare
|
||||||
|
run:
|
||||||
|
name: prepare archlinux dependencies
|
||||||
|
command: |
|
||||||
|
pacman --noconfirm -Syu git openssh ca-certificates-utils
|
||||||
|
useradd -m ci
|
||||||
|
echo "ci ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
|
|
||||||
|
clone-aur:
|
||||||
|
- &archlinux_clone_aur
|
||||||
|
archlinux-run:
|
||||||
|
name: clone aur/scwrypts
|
||||||
|
command: git clone https://aur.archlinux.org/scwrypts.git aur
|
||||||
|
|
||||||
|
clone-scwrypts:
|
||||||
|
- &archlinux_clone_scwrypts
|
||||||
|
archlinux-run:
|
||||||
|
name: clone wrynegade/scwrypts
|
||||||
|
command: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" scwrypts
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
aur-test:
|
||||||
|
executor: archlinux
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- *archlinux_prepare
|
||||||
path: ~/scwrypts
|
- *archlinux_clone_aur
|
||||||
- run: pip install build && python -m build
|
- *archlinux_clone_scwrypts
|
||||||
- run: pip install twine && twine upload dist/*
|
- archlinux-run:
|
||||||
|
name: test makepkg against current build
|
||||||
|
working_directory: /home/ci/aur
|
||||||
|
command: >-
|
||||||
|
:
|
||||||
|
&& PKGVER=$(sed -n "s/^pkgver=//p" ./PKGBUILD)
|
||||||
|
&& cp -r ../scwrypts ../scwrypts-$PKGVER
|
||||||
|
&& tar -czf scwrypts.tar.gz ../scwrypts-$PKGVER
|
||||||
|
&& echo "source=(scwrypts.tar.gz)" >> PKGBUILD
|
||||||
|
&& echo "sha256sums=(SKIP)" >> PKGBUILD
|
||||||
|
&& makepkg --noconfirm -si
|
||||||
|
&& scwrypts --version
|
||||||
|
;
|
||||||
|
|
||||||
|
aur-publish:
|
||||||
|
executor: archlinux
|
||||||
|
steps:
|
||||||
|
- *generic_require_semver_tag
|
||||||
|
- *archlinux_prepare
|
||||||
|
- *archlinux_clone_aur
|
||||||
|
- archlinux-run:
|
||||||
|
name: adjust makepkg checksums
|
||||||
|
working_directory: /home/ci/aur
|
||||||
|
command: >-
|
||||||
|
:
|
||||||
|
&& NEW_VERSION=$(echo $CIRCLE_TAG | sed 's/^v//')
|
||||||
|
&& sed "s/pkgver=.*/pkgver=$NEW_VERSION/; s/^pkgrel=.*/pkgrel=1/; /sha256sums/d" PKGBUILD -i
|
||||||
|
&& makepkg -g >> PKGBUILD
|
||||||
|
&& makepkg --printsrcinfo > .SRCINFO
|
||||||
|
;
|
||||||
|
- archlinux-run:
|
||||||
|
name: test live build
|
||||||
|
working_directory: /home/ci/aur
|
||||||
|
command: >-
|
||||||
|
:
|
||||||
|
&& makepkg --noconfirm -si
|
||||||
|
&& scwrypts --version
|
||||||
|
&& scwrypts --version | grep -q "^scwrypts $CIRCLE_TAG\$"
|
||||||
|
;
|
||||||
|
- archlinux-run:
|
||||||
|
name: publish aur/scwrypts
|
||||||
|
working_directory: /home/ci/aur
|
||||||
|
command: >-
|
||||||
|
:
|
||||||
|
&& git add PKGBUILD .SRCINFO
|
||||||
|
&& git -c user.email=yage@yage.io -c user.name=yage commit -am "$CIRCLE_TAG"
|
||||||
|
&& git remote add upstream aur@aur.archlinux.org/scwrypts.git
|
||||||
|
&& echo "DO THE git push upstream"
|
||||||
|
;
|
||||||
|
|
||||||
nodejs-test:
|
nodejs-test:
|
||||||
executor: nodejs
|
executor: nodejs
|
||||||
@ -108,6 +198,30 @@ jobs:
|
|||||||
&& pnpm publish --no-git-checks \
|
&& pnpm publish --no-git-checks \
|
||||||
;
|
;
|
||||||
|
|
||||||
|
python-test:
|
||||||
|
executor: python
|
||||||
|
working_directory: ~/scwrypts/py/lib
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/scwrypts
|
||||||
|
- run:
|
||||||
|
name: pytest
|
||||||
|
command: |
|
||||||
|
: \
|
||||||
|
&& pip install . .[test] \
|
||||||
|
&& pytest \
|
||||||
|
;
|
||||||
|
- run: pip install build && python -m build
|
||||||
|
|
||||||
|
python-publish:
|
||||||
|
executor: python
|
||||||
|
working_directory: ~/scwrypts/py/lib
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/scwrypts
|
||||||
|
- run: pip install build && python -m build
|
||||||
|
- run: pip install twine && twine upload dist/*
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
python-dev:
|
python-dev:
|
||||||
jobs:
|
jobs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user