-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from apel/release-3.3.0
Release 3.3.0 to master
- Loading branch information
Showing
28 changed files
with
438 additions
and
196 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
# For GitHub Actions, "/" checks for workflow files in .github/workflows. | ||
directory: "/" | ||
schedule: | ||
# By default, this is on Monday. | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build Packages | ||
on: | ||
push: | ||
tags: '[0-9]+.[0-9]+.[0-9]+-*' | ||
schedule: | ||
# If this workflow changes in the future to uploading RPMs directly to a | ||
# release on tag push, then a conditional check should be added for the | ||
# cron to continue uploading as an artifact on the workflow build. | ||
- cron: '41 22 * * SUN' | ||
|
||
jobs: | ||
build-rpm: | ||
runs-on: ubuntu-latest | ||
if: '!github.event.repository.fork' | ||
|
||
env: | ||
# _github_home is the dir used as a volume by the container | ||
RPMDIR: /home/runner/work/_temp/_github_home/rpmbuild | ||
steps: | ||
- name: Install rpmlint | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install rpmlint | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Get all branches and tags so the latest tag can be found for VERSION | ||
fetch-depth: 0 | ||
- name: Set VERSION | ||
run: echo "VERSION=`echo $(git describe --tags $(git rev-list --tags --max-count=1))`" >> $GITHUB_ENV | ||
- name: Set SSMDIR | ||
run: echo "SSMDIR=apel-ssm-$VERSION" >> $GITHUB_ENV | ||
|
||
# Based on the ssm-build-rpm.sh script | ||
- name: Download and rename archive | ||
run: | | ||
wget --no-check-certificate https://github.com/apel/ssm/archive/$VERSION.tar.gz -O $VERSION | ||
tar xzvf $VERSION | ||
mv ssm-$VERSION $SSMDIR | ||
tar czvf $SSMDIR.tar.gz $SSMDIR | ||
sudo mkdir -p $RPMDIR/SOURCES | ||
sudo cp $SSMDIR.tar.gz $RPMDIR/SOURCES | ||
- name: Build RPM package | ||
id: rpm | ||
uses: naveenrajm7/rpmbuild@v1.0.0 | ||
with: | ||
spec_file: "apel-ssm.spec" | ||
|
||
- name: Lint RPMs | ||
continue-on-error: true | ||
run: rpmlint ${{ steps.rpm.outputs.rpm_dir_path }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3.1.2 | ||
with: | ||
name: Binary and Source RPMs | ||
path: | | ||
${{ steps.rpm.outputs.rpm_dir_path }} | ||
${{ steps.rpm.outputs.source_rpm_dir_path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "dev" ] | ||
# Can't use the paths-ignore with 'push' as this would cause missing analyses. | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "dev" ] | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.txt' | ||
- '**/*.ya?ml' | ||
- '**/*.sh' | ||
schedule: | ||
- cron: '39 11 * * 1' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
if: '!github.event.repository.fork' | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
queries: security-extended,security-and-quality | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Docker | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
on: | ||
push: | ||
# Build all branches | ||
branches: '*' | ||
# Build tags which look like ###.###.###-###, i.e. actual releases only | ||
# as any build from a GitHub tag also get's published as latest. | ||
# Note: This is a GitHub actions filter pattern, not a regex | ||
# (see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet). | ||
tags: [ '[0-9]+.[0-9]+.[0-9]+-[0-9]+' ] | ||
pull_request: | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
# Login against a Docker registry | ||
# https://github.com/docker/login-action | ||
name: Login to ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
# Extract metadata (tags, labels) for Docker | ||
# https://github.com/docker/metadata-action | ||
name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- | ||
# Build and push Docker image | ||
# https://github.com/docker/build-push-action | ||
name: Build and push Docker image | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
# Only push containers to the registry on GitHub pushes, | ||
# not pull requests. GitHub won't let a rogue PR create a container | ||
# in the registry without secrets being set up before hand anyway, | ||
# if GitHub were to try without secrets - the action would fail. | ||
push: ${{ github.event_name == 'push' }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Run Unit Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['2.x', '3.x'] | ||
name: Python ${{ matrix.python-version }} test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up dependencies for python-ldap | ||
run: sudo apt-get install libsasl2-dev libldap2-dev libssl-dev | ||
- name: Base requirements for SSM | ||
run: pip install -r requirements.txt | ||
- name: Additional requirements for the unit and coverage tests | ||
run: pip install -r requirements-test.txt | ||
- name: Pre-test set up | ||
run: | | ||
export TMPDIR=$PWD/tmp | ||
mkdir $TMPDIR | ||
export PYTHONPATH=$PYTHONPATH:`pwd -P` | ||
cd test | ||
- name: Run unit tests | ||
run: coverage run --branch --source=ssm,bin -m unittest discover --buffer | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# See https://pre-commit.com for more information | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
hooks: | ||
# Python related checks | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
- id: name-tests-test | ||
name: Check unit tests start with 'test_' | ||
args: ['--django'] | ||
files: 'test/.*' | ||
# Other checks | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
name: Force line endings to LF | ||
args: ['--fix=lf'] | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.9.0 | ||
hooks: | ||
- id: python-check-mock-methods | ||
- id: python-no-eval | ||
- id: python-no-log-warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,3 @@ case "$1" in | |
esac | ||
|
||
exit $RETVAL | ||
|
Oops, something went wrong.