-
Notifications
You must be signed in to change notification settings - Fork 14
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 #42 from greg-hellings/better_releases
- Loading branch information
Showing
22 changed files
with
30 additions
and
61 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -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 | ||
|
@@ -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 }} |
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 |
---|---|---|
@@ -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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
roles/chrony/molecule/docker/molecule.yml → ...dless_ssh/molecule/container/molecule.yml
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule tests
updated
5 files
+6 −0 | .gitignore | |
+0 −2 | ansible-lint | |
+4 −0 | ansible-lint.yml | |
+0 −5 | molecule.yml | |
+2 −0 | yamllint.yml |