cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
+ test-lint:
+ name: Test with Python ${{ matrix.python-version }}
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ python-version:
+ - "3.9"
+ - "3.10"
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: pip install -r requirements-dev.txt
+
+ - name: Lint with ruff
+ run: ruff phase*/master.cfg
+
+# FIXME
+# - name: Stylecheck with black
+# run: black phase*/master.cfg
+
build-test-push:
name: Build, test and push containers
runs-on: ubuntu-latest
+ needs: test-lint
permissions:
packages: write
comment = branches[branch].get("usign_comment") or "untrusted comment: secret key"
seckey = branches[branch].get("usign_key")
seckey = base64.b64decode(seckey)
- except:
+ except Exception:
return None
return "{}\n{}".format(re.sub(r"\bsecret key$", "public key", comment),
# check out the source
# Git() runs:
- # if repo doesn't exist: 'git clone repourl'
- # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -f -f -d -x'. Only works with mode='full'
- # git cat-file -e <commit>
- # git checkout -f <commit>
- # git checkout -B <branch>
- # git rev-parse HEAD
+ # if repo doesn't exist: 'git clone repourl'
+ # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -f -f -d -x'. Only works with mode='full'
+ # git cat-file -e <commit>
+ # git checkout -f <commit>
+ # git checkout -B <branch>
+ # git rev-parse HEAD
factory.addStep(Git(
name = "git",
repourl = repo_url,
import re
import sys
import base64
-import random
import subprocess
import configparser
for section in ini.sections():
if section.startswith("worker "):
if ini.has_option(section, "name") and ini.has_option(section, "password") and \
- ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
+ ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
name = ini.get(section, "name")
password = ini.get(section, "password")
sl_props = { 'shared_wd': False }
def UsignSec2Pub(seckey, comment="untrusted comment: secret key"):
try:
seckey = base64.b64decode(seckey)
- except:
+ except Exception:
return None
return "{}\n{}".format(re.sub(r"\bsecret key$", "public key", comment),
if last_build and last_build[0]:
last_complete_at = last_build[0]['complete_at']
if last_complete_at and (last_complete_at > complete_at):
- return last_complete_at
+ return last_complete_at
return complete_at
description = "Uploading source archives",
workdir = "build/sdk",
command = ["rsync", "--files-from=sourcelist", "-4", "--progress", "--checksum", "--delay-updates",
- WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
+ WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
env={'RSYNC_PASSWORD': rsync_src_key},
haltOnFailure = False,
flunkOnFailure = False,