Skip to content

Commit

Permalink
Merge pull request #42 from greg-hellings/better_releases
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-hellings authored Apr 21, 2021
2 parents d65b6ae + 29fb598 commit bed4f0a
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 61 deletions.
71 changes: 17 additions & 54 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,34 @@ on:
pull_request: {}
schedule:
- cron: '12 0 * * *'
release:
types:
- published
- prereleased

env:
TOX_ANSIBLE_DRIVER: docker
ANSIBLE_COLLECTIONS_PATHS: ~/.ansible/:~/work/
ANSIBLE_COLLECTIONS_PATH: ~/.ansible:~/work
checkout_path: ansible_collections/oasis_roles/system

jobs:
collect:
runs-on: ubuntu-latest
outputs:
scenarios: ${{ steps.collection.outputs.scenarios }}
scenarios: ${{ steps.collection.outputs.tox-envs }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-modules
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
set -ex
python -m pip install --upgrade pip
pip install tox tox-ansible
python -m pip install --upgrade tox
- name: collect depenencies
id: collection
run: |
set -ex
json="["
for x in $(tox -l --ansible-driver docker); do
json="${json}\"${x}\","
done
json="${json%,}]"
echo "::set-output name=scenarios::${json}"
uses: greg-hellings/tox-list@v1

build:
needs: collect
Expand All @@ -61,57 +50,31 @@ jobs:
run: |
cd "${{ env.checkout_path }}"
git submodule update --remote --recursive
- name: Setup pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-modules
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
set -ex
sudo apt-get update
sudo apt-get install -y libapt-pkg-dev build-essential python3-setuptools python3-apt
python -m pip install --upgrade pip
pip install -U setuptools wheel
pip install tox tox-ansible
pip install tox
- name: Run tox against ${{ matrix.scenario }}
run: |
set -ex
# There is some magic in the "mv" command that makes ansible-galaxy work
# I haven't found any logic for it, but if you don't do this mv, then
# the dependency step in molecule when run from tox will fail
mv ansible_collections ~/work/
mv ansible_collections ~/work
cd ~/work/${{ env.checkout_path }}
tox -e ${{ matrix.scenario }}
release:
needs: build # Only release if the build is good
if: startsWith(github.ref, 'refs/tags/') # Only release if there is a tag that's been pushed to the repo
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install pip
run: |
python -m pip install --upgrade pip
pip install ansible
- name: Create release artifacts
run: |
ansible-galaxy collection build
ansible-galaxy collection publish *.tar.gz --api-key ${{ secrets.GALAXY_API_KEY }}
- name: Release artifacts to Git Hub
uses: ncipollo/release-action@v1
- uses: artis3n/[email protected]
with:
artifacts: ./oasis_roles-system*.tar.gz
allowUpdates: true
name: Release ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
api_key: ${{ secrets.GALAXY_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__
*.tar.gz
.tox
junit.xml
.cache

# Ansible Tower license files
roles/ansible_tower/molecule/default/license.json
Expand Down
10 changes: 10 additions & 0 deletions roles/chrony/molecule/container/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: chrony-vagrant
box: generic/rhel8
config_options:
synced_folder: false
cachier: false
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
driver:
name: docker
platforms:
- name: chrony_docker
- name: passwordless_ssh_docker
image: centos/systemd
privileged: true
command: /usr/lib/systemd/systemd --system
Expand Down
5 changes: 0 additions & 5 deletions roles/passwordless_ssh/molecule/docker/molecule.yml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion tests

0 comments on commit bed4f0a

Please sign in to comment.