Skip to content

Commit

Permalink
add tests to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzaps committed Mar 25, 2022
1 parent 205ec4c commit 5da02ad
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/CI.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/ManualBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Manual Build

on: workflow_dispatch

jobs:
build-linux:
name: Build linux binaries
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: ./build.sh
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: ampm-linux-binaries
if-no-files-found: error
path: |
dist/ampm.tar.gz
dist/get_ampm.sh
test-linux:
name: Test linux binaries
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: python3.8 -m pip install pytest
- name: Run Tests
run: ./run-tests.sh
45 changes: 45 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: ./build.sh
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ampm ${{ github.ref }}
body: ''
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/ampm.tar.gz
asset_name: ampm.tar.gz
asset_content_type: application/gzip
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/get_ampm.sh
asset_name: get_ampm.sh
asset_content_type: text/x-shellscript
1 change: 1 addition & 0 deletions ampm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.0'
2 changes: 2 additions & 0 deletions ampm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ampm.repo.base import ArtifactQuery, AmbiguousQueryError, RepoGroup, QueryNotFoundError, \
ArtifactMetadata, ArtifactRepo, REMOTE_REPO_URI
from ampm.repo.local import LOCAL_REPO
from ampm import __version__


class OrderedGroup(click.Group):
Expand All @@ -27,6 +28,7 @@ def list_commands(self, ctx: click.Context) -> Mapping[str, click.Command]:


@click.group(cls=OrderedGroup)
@click.version_option(__version__)
@click.option('-s', '--server', help=f'Remote repository server (default: {REMOTE_REPO_URI})')
@click.pass_context
def cli(ctx: click.Context, server: Optional[str]):
Expand Down
2 changes: 2 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

set -ex

PYTHONPATH='vendor:.' pytest tests/ -rP "$@"

0 comments on commit 5da02ad

Please sign in to comment.