Skip to content

Commit

Permalink
Merge pull request #56 from chevah/25-py3-support
Browse files Browse the repository at this point in the history
[#25] Get the code working on py3.
  • Loading branch information
adiroiban authored Mar 26, 2024
2 parents df2a766 + d5507b9 commit 04cba86
Show file tree
Hide file tree
Showing 31 changed files with 5,185 additions and 4,102 deletions.
96 changes: 64 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,109 +10,141 @@ on:
paths:
- '**.py'

permissions:
contents: read


concurrency:
group: chevah-keycert-${{ github.ref }}
cancel-in-progress: true


env:
CHEVAH_BUILD: "build-py3"

jobs:

ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
build-keycert
build-py3
key: ${{ runner.os }}-${{ hashFiles('setup.py') }}

- name: Deps
run: ./brink.sh deps

- name: Lint
run: ./brink.sh lint
run: |
./pythia.sh deps
- name: Rename build to unicode
run: mv build-keycert build-keycert
run: mv build-py3 build-py3

- name: Test
run: ./brink.sh test
run: ./pythia.sh test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CHEVAH_BUILD: 'build-keycert'
CHEVAH_BUILD: 'build-py3'

- name: Rename build from unicode for cache
run: mv build-keycert-ț build-keycert
run: mv build-py3-ț build-py3


macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
build-keycert
build-py3
key: ${{ runner.os }}-${{ hashFiles('setup.py') }}

- name: Deps
run: ./brink.sh deps
run: ./pythia.sh deps

- name: Test
run: ./brink.sh test
run: ./pythia.sh test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
build-keycert
build-by3
key: ${{ runner.os }}-${{ hashFiles('setup.py') }}

- name: Deps
run: sh ./brink.sh deps
run: sh ./pythia.sh deps

- name: Test
run: sh ./brink.sh test
run: sh ./pythia.sh test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


keys-interop:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config:
- { test_type: load_dsa }
- { test_type: load_rsa }
- { test_type: load_eced }
- { test_type: generate }
- test_type: "--load dsa"
- test_type: "--load rsa"
- test_type: "--load ecdsa"
- test_type: "--load ed25519"
- test_type: "--generate ' '" # We generate all key types
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
build-keycert
build-py3
key: ${{ runner.os }}-${{ hashFiles('setup.py') }}

- name: Deps
run: |
sudo apt-get --quiet install putty-tools
./brink.sh deps
./pythia.sh deps
- name: Test
run: ./brink.sh test_interop_${{ matrix.config.test_type }}
run: ./pythia.sh test_interop ${{ matrix.config.test_type }}

lint:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Cache build
uses: actions/cache@v3
with:
path: |
build-py3
key: ${{ runner.os }}-${{ hashFiles('setup.py') }}

- name: Deps
run: |
./pythia.sh deps
- name: Lint
run: ./pythia.sh lint
13 changes: 2 additions & 11 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Auto-released on PyPi using Travis-CI for each tag.
Build development environment and activate it.
It uses the chevah-brink script to create the virtual environment ::

./brink.sh deps
./pythia.sh deps

Run checks executed on Travis-CI: test, linters and coverage::

./brink.sh test
./pythia.sh test

Default virtual environment is created in build/venv.

Expand All @@ -22,12 +22,3 @@ You can manually test the command line tools::

$ ./build/venv/bin/python keycert-demo.py

Linux, OS X and Windows tests executed on private Buildbot server as Travis CI
is Linux only::

# See available builders
./brink.sh remote
# Trigger a builder
./brink.sh remote [--wait] -b keycert-win-2008
# Trigger a builder with running the clean step
./brink.sh remote -b keycert-win-2008 --properties=force_purge=yes
5 changes: 0 additions & 5 deletions brink.conf

This file was deleted.

Loading

0 comments on commit 04cba86

Please sign in to comment.