diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml new file mode 100644 index 0000000..c002ede --- /dev/null +++ b/.github/workflows/galaxy.yml @@ -0,0 +1,24 @@ +--- +name: Ansible Galaxy import +on: + push: + tags: + - '*' +jobs: + galaxy: + name: Galaxy + runs-on: ubuntu-latest + steps: + - name: Check out the codebase + uses: actions/checkout@v2 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Ansible + run: pip3 install ansible-base==2.10.3 + + - name: Import release to Ansible Galaxy + run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml new file mode 100644 index 0000000..a1e63a0 --- /dev/null +++ b/.github/workflows/molecule.yml @@ -0,0 +1,59 @@ +--- +name: Molecule CI/CD +on: + pull_request: + push: + branches: + - main + schedule: + - cron: "0 0 1 * *" +jobs: + molecule: + name: Molecule + runs-on: ubuntu-latest + strategy: + matrix: + scenario: + - default + - default_alpine + - default_centos + - module + - module_alpine + - module_centos + - plus + - plus_alpine + - plus_centos + - source + - source_alpine + - source_centos + - stable_push_alpine + - stable_push_centos + - template + - template_alpine + - template_centos + steps: + - name: Check out the codebase + uses: actions/checkout@v2 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Molecule dependencies + run: | + pip3 install ansible-base==2.10.3 + pip3 install ansible==2.10.3 + pip3 install ansible-lint==4.3.7 + pip3 install yamllint==1.25.0 + pip3 install 'molecule[docker]'==3.2.1 + pip3 install docker==4.4.0 + + - name: Run Molecule tests + run: molecule test -s ${{ matrix.scenario }} + if: contains(${{ matrix.scenario }}, 'plus') && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + NGINX_CRT: ${{ secrets.NGINX_CRT }} + NGINX_KEY: ${{ secrets.NGINX_KEY }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3caf89b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -language: python -services: docker -branches: - only: - - main -jobs: - include: - - name: (Debian/Ubuntu) Install specific version - env: - scenario: default - - name: (Alpine Linux) Install specific version - env: - scenario: default_alpine - - name: (CentOS) Install specific version - env: - scenario: default_centos - - name: (Debian/Ubuntu) Cleanup config and try to install modules - env: - scenario: module - - name: (Alpine Linux) Cleanup config and try to install modules - env: - scenario: module_alpine - - name: (CentOS) Cleanup config and try to install modules - env: - scenario: module_centos - - name: (Debian/Ubuntu) Install NGINX Plus - if: not (type = "pull_request" and fork = "true") - env: - scenario: plus - - name: (Alpine Linux) Install NGINX Plus - if: not (type = "pull_request" and fork = "true") - env: - scenario: plus_alpine - - name: (CentOS) Install NGINX Plus - if: not (type = "pull_request" and fork = "true") - env: - scenario: plus_centos - - name: (Debian/Ubuntu) Install stable branch and push a config - env: - scenario: stable_push - - name: (Alpine Linux) Install stable branch and push a config - env: - scenario: stable_push_alpine - - name: (CentOS) Install stable branch and push a config - env: - scenario: stable_push_centos - - name: (Debian/Ubuntu) Test config templates - env: - scenario: template - - name: (Alpine Linux) Test config templates - env: - scenario: template_alpine - - name: (CentOS) Test config templates - env: - scenario: template_centos - - name: (Debian/Ubuntu) Build from source - env: - scenario: source - - name: (Alpine Linux) Build from source - env: - scenario: source_alpine - - name: (CentOS) Build from source - env: - scenario: source_centos -before_install: - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt-get update - - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce -install: - - pip install ansible-base==2.10.3 - - pip install ansible==2.10.3 - - pip install ansible-lint==4.3.7 - - pip install yamllint==1.25.0 - - pip install 'molecule[docker]'==3.2.0 - - pip install docker==4.4.0 -script: - - travis_wait 50 molecule test -s $scenario -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 94abe05..cb68486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ ENHANCEMENTS: -* Update Molecule to `3.2.0` and Docker Python SDK to `4.4.0`. +* Update Molecule to `3.2.1` and Docker Python SDK to `4.4.0`. * Add Alpine `3.12` to supported platforms for NGINX Plus. * Remove Alpine `3.9` and CentOS/RHEL `6` from supported platforms due to EOL. +* Replace TravisCI with GitHub actions. ## 0.18.1 (November 17, 2020)