Skip to content

Commit

Permalink
Merge pull request #3 from darkwizard242/feature/update-workflows
Browse files Browse the repository at this point in the history
Update workflows
  • Loading branch information
darkwizard242 committed Feb 16, 2022
2 parents cfd3d53 + 88895cf commit bec094f
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 65 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
- 'master'
push:
branches:
- 'feature*'
- 'feature_*'
- 'feature/*'
- 'hotfix/*'
- 'hotfix*'
- 'master'
schedule:
- cron: '0 0 * * *'
Expand All @@ -17,19 +21,20 @@ jobs:
code_quality:

name: SonarCloud Code Quality Check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.stacer'
fetch-depth: 0

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: 'darkwizard242.stacer'
args: >
-Dsonar.projectVersion=${{ github.ref }}_${{ github.run_number }}
env:
Expand All @@ -40,23 +45,23 @@ jobs:
build:

name: Build & Test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
max-parallel: 8
max-parallel: 6
matrix:
IMAGE: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
IMAGE: [ubuntu-20.04, ubuntu-18.04]

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.stacer'

- name: Set up Python 3.8
- name: Set up Python 3.10.0
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10.0

- name: Update repo cache, install python3-setuptools and required pip modules
run: |
Expand All @@ -65,6 +70,7 @@ jobs:
pip3 install -U pip wheel ansible molecule[docker] docker ansible-lint flake8 pytest-testinfra
- name: Execute Molecule test of role for ${{ matrix.IMAGE }}
working-directory: 'darkwizard242.stacer'
run: DISTRO=${{ matrix.IMAGE }} molecule test
env:
PY_COLORS: '1'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
release:

name: Release
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.stacer'

- name: Set up Python 3.8
- name: Set up Python 3.10.0
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10.0

- name: Update repo cache, install python3-setuptools and required pip modules
run: |
Expand All @@ -31,4 +31,5 @@ jobs:
pip3 install -U pip wheel ansible
- name: Import to Ansible Galaxy.
working-directory: 'darkwizard242.stacer'
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} ${{ github.repository_owner }} $(echo ${{ github.repository }} | sed 's/.*\///')
41 changes: 0 additions & 41 deletions .travis.yml.bk

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Ali Muhammad
Copyright (c) 2022 Ali Muhammad

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ stacer_ubuntu_repo_filename: stacer
### Variables table:
Variable | Value (default) | Description
-------------------------------- | ------------------------ | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stacer_app | stacer | Defines the app to install i.e. **stacer**
stacer_package_desired_state | present | Defined to dynamically chose whether to install (i.e. either `present` or `latest`) or uninstall (i.e. `absent`) the package. Default is set to `present`.
stacer_ubuntu_repo | 'ppa:oguzhaninan/stacer' | Refers to the ppa repo to add. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._
stacer_ubuntu_repo_desired_state | present | Defined to dynamically chose whether to add/keep (i.e. `present`) or remove (i.e. `absent`) the repository file list from `/etc/apt/sources.list.d`. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._
stacer_ubuntu_repo_filename | stacer | Defined to set the repository file name for saving in `/etc/apt/sources.list.d`. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._
Variable | Description
-------------------------------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stacer_app | Defines the app to install i.e. **stacer**
stacer_package_desired_state | Defined to dynamically chose whether to install (i.e. either `present` or `latest`) or uninstall (i.e. `absent`) the package. Default is set to `present`.
stacer_ubuntu_repo | Refers to the ppa repo to add. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._
stacer_ubuntu_repo_desired_state | Defined to dynamically chose whether to add/keep (i.e. `present`) or remove (i.e. `absent`) the repository file list from `/etc/apt/sources.list.d`. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._
stacer_ubuntu_repo_filename | Defined to set the repository file name for saving in `/etc/apt/sources.list.d`. _Applies only to Ubuntu (16.04 and 18.04) systems, not required for Ubuntu 20.04 systems._

## Dependencies

Expand Down Expand Up @@ -72,4 +72,4 @@ For customizing behavior of role (i.e. un-installation of **stacer** package) in

## Author Information

This role was created by [Ali Muhammad](https://www.linkedin.com/in/ali-muhammad-759791130/).
This role was created by [Ali Muhammad](https://www.alimuhammad.dev/).
1 change: 0 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal

Expand Down
2 changes: 2 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
hosts: all
roles:
- role: darkwizard242.stacer
vars:
ansible_python_interpreter: /usr/bin/python3
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ lint: |
ansible-lint
flake8
platforms:
- name: ${DISTRO:-ubuntu-18.04}
image: "darkwizard242/ansible:${DISTRO:-ubuntu-18.04}"
- name: ${DISTRO:-ubuntu-20.04}
image: "darkwizard242/ansible:${DISTRO:-ubuntu-20.04}"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
pre_build_image: true
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sonar.projectKey=ansible-role-stacer
sonar.organization=tech-overlord-github
sonar.projectName=ansible-role-stacer
sonar.coverage.exclusions=**/**
sonar.python.version=3
#sonar.projectVersion=$TRAVIS_JOB_ID

# =====================================================
Expand Down

0 comments on commit bec094f

Please sign in to comment.