Skip to content

Commit 48b135a

Browse files
authored
update version and migrate to github action (#20)
1 parent 09d7dde commit 48b135a

File tree

7 files changed

+143
-21
lines changed

7 files changed

+143
-21
lines changed

.github/workflows/codeql.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [master]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [master]
20+
schedule:
21+
- cron: '0 23 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: ['python']
32+
# CodeQL supports [ $supported-codeql-languages ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8, 3.9]
13+
os: [ubuntu-latest]
14+
include:
15+
- python-version: pypy3
16+
os: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
pip install --upgrade keyring==21.4.0 setuptools wheel twine coveralls tox
27+
- name: Run pylint & codestyle & unit tests
28+
run: |
29+
tox
30+
- name: Publish coverage report
31+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
coveralls --service=github
36+
- name: Run twine check
37+
run: |
38+
python setup.py sdist bdist_wheel
39+
twine check dist/*

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
[![Build Status](https://travis-ci.com/joelee2012/claircli.svg?branch=master)](https://travis-ci.com/joelee2012/claircli)
1+
[![Tests](https://github.com/joelee2012/claircli/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/joelee2012/claircli/actions/workflows/tests.yml)
2+
[![CodeQL](https://github.com/joelee2012/claircli/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/joelee2012/claircli/actions/workflows/codeql.yml)
23
[![Coverage Status](https://coveralls.io/repos/github/joelee2012/claircli/badge.svg?branch=master)](https://coveralls.io/github/joelee2012/claircli?branch=master)
4+
![PyPI](https://img.shields.io/pypi/v/claircli)
5+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/claircli)
6+
![PyPI - Wheel](https://img.shields.io/pypi/wheel/claircli)
7+
![GitHub](https://img.shields.io/github/license/joelee2012/claircli)
8+
39
# claircli
410
## claircli is a command line tool to interact with [Quay Clair](https://github.com/quay/clair), which has following functionalities:
511
- analyze docker images in local host
612
- analyze docker images in remote host
713
- analyze docker images in secure/insecure registry
814
- support threshold/whitelist for vulnerabilities
15+
- support fat manifests
916
- report to HTML/JSON, the html report is based on [template](https://github.com/jgsqware/clairctl/blob/master/clair/templates/analysis-template.html)
1017

1118
# Installation
1219

1320
```bash
14-
pip install claircli
21+
python3 -m pip install claircli
1522
```
1623

1724
# Commands

claircli/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '1.2'
2+
__version__ = '1.3'
33
__title__ = 'claircli'
44
__description__ = 'Command line tool to interact with Clair'
55
__url__ = 'https://github.com/joelee2012/claircli'

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'Programming Language :: Python :: 3.6',
5757
'Programming Language :: Python :: 3.7',
5858
'Programming Language :: Python :: 3.8',
59+
'Programming Language :: Python :: 3.9',
5960
'Topic :: Software Development',
6061
],
6162
)

0 commit comments

Comments
 (0)