Skip to content

Commit

Permalink
Merge branch 'GrafeasGroup:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erenbektas authored Aug 24, 2022
2 parents 70e611d + 83a6c60 commit 0cbe674
Show file tree
Hide file tree
Showing 61 changed files with 1,022 additions and 608 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,44 @@
name: Automated Testing

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
analyze:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.10.x'
architecture: 'x64'
- run: |
pip install --upgrade pip
pip install poetry
hash -r
poetry install -v --extras ci
poetry install
- run: poetry run mypy .
- run: poetry run flake8 .

test:
runs-on: ubuntu-18.04
strategy:
max-parallel: 4
matrix:
python-version:
- '3.9'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
- name: Setup Python 3.10
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10.x'
architecture: 'x64'
- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry
hash -r
poetry install -v --extras ci
poetry install
- run: poetry run pytest --cov=tor
41 changes: 41 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- name: Install Env
# shiv will download the dependencies it needs on its own
run: |
pip install --upgrade pip
pip install shiv
pip install poetry
pip install poetry2setup
- name: Add CURRENT_TIME env property
# the smart thing to do here would be to use the commit hash, but
# github releases are ALPHABETIZED, so a commit hash of `abcdef` will
# not be listed as the latest release if `defabc` came before. (╥﹏╥)
run: echo "CURRENT_TIME_VERSION=v$(date '+%s')" >> $GITHUB_ENV
- name: Build the sucker
run: |
sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" tor/__init__.py
make build
- uses: ncipollo/release-action@v1
with:
artifacts: "build/tor.pyz"
body: "It's releasin' time"
generateReleaseNotes: true
tag: ${{ env.CURRENT_TIME_VERSION }}
commit: main
token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build tor.pyz and test

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- name: Install Env
# shiv will download the dependencies it needs on its own
run: |
pip install --upgrade pip
pip install shiv
pip install poetry
pip install poetry2setup
- name: Add CURRENT_TIME env property
# the smart thing to do here would be to use the commit hash, but
# github releases are ALPHABETIZED, so a commit hash of `abcdef` will
# not be listed as the latest release if `defabc` came before. (╥﹏╥)
run: echo "CURRENT_TIME_VERSION=v$(date '+%s')" >> $GITHUB_ENV
- name: Build the sucker
run: |
sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" tor/__init__.py
make build
- name: Remove source to make sure it doesn't interfere with the tests
run: rm -rf tor/
- name: Run selfcheck on compiled binary
run: ./build/tor.pyz selfcheck
31 changes: 0 additions & 31 deletions .github/workflows/publish.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@ ENV/
praw.ini
*.port
*.sw[op]

# build artifacts
tor.pyz
setup.py
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft tor/test/
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
setup:
poetry2setup > setup.py

build: setup shiv

clean:
rm setup.py

shiv:
mkdir -p build
shiv -c tor -o build/tor.pyz . --compressed
Loading

0 comments on commit 0cbe674

Please sign in to comment.