Skip to content

Commit

Permalink
Merge pull request #45 from shanemcd/gha
Browse files Browse the repository at this point in the history
Add GitHub Actions
  • Loading branch information
shanemcd authored Apr 5, 2021
2 parents a7e8792 + 9e7f5d3 commit bc7a97e
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 10 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---

name: CI

on:
pull_request:
branches: [devel]

push:
branches: [devel]

jobs:
podman:
runs-on: ubuntu-20.04
name: Podman
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build EE with Podman
run: |
tox -e podman
docker:
runs-on: ubuntu-20.04
name: Docker
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build EE with Docker
env:
DOCKER_BUILDKIT: 1
run: |
tox -e docker
check_diff:
runs-on: ubuntu-20.04
name: Ensure build context is up-to-date
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run
env:
DOCKER_BUILDKIT: 1
run: |
tox -e check-diff
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
release:
types:
- created

jobs:
release:
runs-on: ubuntu-20.04
name: Release
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build image
env:
DOCKER_BUILDKIT: 1
run: |
tox -e docker -- --tag=awx-ee:${{ github.event.release.tag_name }}
- name: Push To Quay
uses: redhat-actions/[email protected]
with:
image: awx-ee
tags: ${{ github.event.release.tag_name }}
registry: quay.io/ansible/
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
2 changes: 1 addition & 1 deletion .zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- github.com/ansible/ansible-builder
nodeset: ubuntu-bionic-2vcpu
vars:
tox_envlist: ansible-builder
tox_envlist: check-diff
tox_install_siblings: false

- job:
Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY --from=galaxy /usr/share/ansible /usr/share/ansible
COPY --from=builder /output/ /output/
RUN /output/install-from-bindep && rm -rf /output/wheels
RUN alternatives --set python /usr/bin/python3
COPY --from=quay.io/project-receptor/receptor:0.9.6 /usr/bin/receptor /usr/bin/receptor
COPY --from=quay.io/project-receptor/receptor:0.9.7 /usr/bin/receptor /usr/bin/receptor
RUN mkdir -p /var/run/receptor
ADD run.sh /run.sh
CMD /run.sh
Expand Down
3 changes: 1 addition & 2 deletions _build/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ collections:
version: ee_req_install
type: git
- name: community.vmware # has requirements.txt, but may add pyvcloud
- name: https://github.com/shanemcd/ovirt-ansible-collection
type: git
- name: ovirt.ovirt
- name: https://github.com/ansible-collections/community.kubernetes.git
type: git
# adds openshift python lib
Expand Down
6 changes: 5 additions & 1 deletion _build/requirements_combined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ azure-mgmt-compute==10.0.0 # from collection azure.azcollection
azure-mgmt-containerinstance==1.4.0 # from collection azure.azcollection
azure-mgmt-containerregistry==2.0.0 # from collection azure.azcollection
azure-mgmt-containerservice==9.1.0 # from collection azure.azcollection
azure-mgmt-datalake-store==0.5.0 # from collection azure.azcollection
azure-mgmt-dns==2.1.0 # from collection azure.azcollection
azure-mgmt-keyvault==1.1.0 # from collection azure.azcollection
azure-mgmt-marketplaceordering==0.1.0 # from collection azure.azcollection
azure-mgmt-monitor==0.5.2 # from collection azure.azcollection
azure-mgmt-managedservices==1.0.0 # from collection azure.azcollection
azure-mgmt-managementgroups==0.2.0 # from collection azure.azcollection
azure-mgmt-network==10.2.0 # from collection azure.azcollection
azure-mgmt-nspkg==2.0.0 # from collection azure.azcollection
azure-mgmt-privatedns==0.1.0 # from collection azure.azcollection
Expand All @@ -45,6 +47,8 @@ azure-mgmt-devtestlabs==3.0.0 # from collection azure.azcollection
azure-mgmt-loganalytics==1.0.0 # from collection azure.azcollection
azure-mgmt-automation==0.1.1 # from collection azure.azcollection
azure-mgmt-iothub==0.7.0 # from collection azure.azcollection
azure-mgmt-recoveryservices==0.4.0 # from collection azure.azcollection
azure-mgmt-recoveryservicesbackup==0.6.0 # from collection azure.azcollection
openshift>=0.6.2 # from collection community.kubernetes
requests-oauthlib # from collection community.kubernetes
pyvmomi # from collection community.vmware
Expand All @@ -53,5 +57,5 @@ google-auth # from collection google.cloud
openstacksdk>=0.44 # from collection openstack.cloud
keystoneauth1>=3.4.0 # from collection openstack.cloud
jsonpatch # from collection openstack.cloud
ovirt-engine-sdk-python>=4.4.0 # from collection ovirt.ovirt
ovirt-engine-sdk-python>=4.4.10 # from collection ovirt.ovirt
ipaddress # from collection theforeman.foreman
2 changes: 1 addition & 1 deletion execution-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
additional_build_steps:
append:
- RUN alternatives --set python /usr/bin/python3
- COPY --from=quay.io/project-receptor/receptor:0.9.6 /usr/bin/receptor /usr/bin/receptor
- COPY --from=quay.io/project-receptor/receptor:0.9.7 /usr/bin/receptor /usr/bin/receptor
- RUN mkdir -p /var/run/receptor
- ADD run.sh /run.sh
- CMD /run.sh
Expand Down
18 changes: 14 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ basepython = python3
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt

[testenv:build]
[testenv:podman]
passenv =
HOME
whitelist_external =
Expand All @@ -16,9 +16,19 @@ commands =
/bin/bash -c "podman rmi quay.io/ansible/awx-ee:latest || true"
ansible-builder build -v3 -c . -t quay.io/ansible/awx-ee {posargs}

[testenv:ansible-builder]

[testenv:docker]
passenv =
HOME DOCKER_BUILDKIT
whitelist_external =
true
commands =
/bin/bash -c "podman rmi quay.io/ansible/awx-ee:latest || true"
ansible-builder build -v3 -c . -t quay.io/ansible/awx-ee {posargs} --container-runtime=docker

[testenv:check-diff]
passenv =
{[testenv:build]passenv}
{[testenv:docker]passenv}
commands =
{[testenv:build]commands}
{[testenv:docker]commands}
{toxinidir}/tools/check_ansible_builder_changed.sh

0 comments on commit bc7a97e

Please sign in to comment.