Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework CI for merged roles #22

Closed
D3DeFi opened this issue Apr 30, 2020 · 15 comments
Closed

Rework CI for merged roles #22

D3DeFi opened this issue Apr 30, 2020 · 15 comments
Assignees
Labels
enhancement New feature or request role The issue or pull request is related to Zabbix role

Comments

@D3DeFi
Copy link
Contributor

D3DeFi commented Apr 30, 2020

SUMMARY

Current candidate - Github Actions from previous Travis CI. Example of working CI with Actions:
https://github.com/ericsysmin/ansible-collection-system/tree/master/.github/workflows

More information in:

Dependent on the completion of #20.

We should look at how the whole CI operates after this is solved. There is probably no need to run tests for plugins when a change to role occurs.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

.github/workflows/roles.yml

@D3DeFi D3DeFi added the enhancement New feature or request label Apr 30, 2020
@D3DeFi D3DeFi changed the title Rework CI for merged roles. Rework CI for merged roles Apr 30, 2020
@ericsysmin
Copy link
Contributor

@D3DeFi I can include this on my PR with the changes as it seems we can use

on:
  push:
    paths:
    - 'sub-project/**'
    - '!sub-project/docs/**'

@ericsysmin
Copy link
Contributor

ericsysmin commented Apr 30, 2020

working example from one of my new collections

name: "Role: ericsysmin.system.chrony Molecule Test"
on:
  push:
    paths:
      - roles/chrony/**
      - .github/workflows/chrony.yml
  pull_request:
    paths:
      - roles/chrony/**
      - .github/workflows/chrony.yml
jobs:
  roles_test:
    runs-on: ubuntu-18.04
    env:
      PY_COLORS: 1
      ANSIBLE_FORCE_COLOR: 1
    strategy:
      fail-fast: false
      matrix:
        molecule_distro:
          - distro: centos:7
            command: /usr/sbin/init
          - distro: centos:8
            command: /usr/sbin/init
        collection_role:
          - chrony
    steps:
      - name: Check out code
        uses: actions/checkout@v1
        with:
          path: ansible_collections/ericsysmin/system

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

      - name: Install dependencies
        run: |
          sudo apt install docker
          python -m pip install --upgrade pip
          pip install molecule yamllint ansible-lint docker

      - name: Run role test
        run: >-
          molecule --version &&
          ansible --version &&
          MOLECULE_COMMAND=${{ matrix.molecule_distro.command }}
          MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }}
          molecule --debug test -s ${{ matrix.collection_role }}

@D3DeFi
Copy link
Contributor Author

D3DeFi commented Apr 30, 2020

@D3DeFi I can include this on my PR with the changes as it seems we can use

on:
  push:
    paths:
    - 'sub-project/**'
    - '!sub-project/docs/**'

Oh that is great :) Yes, lets use that.

@sky-joker
Copy link
Contributor

I've assigned this task to @ericsysmin

@ericsysmin
Copy link
Contributor

While doing the rework, I ran into this, so we'll likely need to fix it
ericsysmin#1

@ericsysmin
Copy link
Contributor

So, we have some problems with dependencies on Ansible Molecule that cause any role with dependencies to fail. We may need to merge with existing roles and stick with lint tests for now until Molecule has a new release.

@D3DeFi
Copy link
Contributor Author

D3DeFi commented May 27, 2020

So, we have some problems with dependencies on Ansible Molecule that cause any role with dependencies to fail. We may need to merge with existing roles and stick with lint tests for now until Molecule has a new release.

@ericsysmin can I do something to help with this? I am probably a bit lost.

Is this some known bug when Molecule is testing a role residing in collection with external dependencies like geerlingguy.apache for example?

@ericsysmin
Copy link
Contributor

ericsysmin commented Jun 5, 2020

Yes, that's the issue I ran into. So testing this is going to be hard until the issue is fixed on molecule. I had a PR for one of the issues but not enough people hit the other one I ran into, and there were a ton of new PR's being made so I wasn't sure if someone caught and fixed this one. I don't know how to fix this one, but did fix installing collections themselves. But geerlingguy.apache wasn't in a collection yet.

@ericsysmin
Copy link
Contributor

Is it possible we schedule a meeting for like 30 minutes so we can discuss some items?

@D3DeFi
Copy link
Contributor Author

D3DeFi commented Jun 6, 2020

Is it possible we schedule a meeting for like 30 minutes so we can discuss some items?

We can give it a shot, hit me up on [email protected] so we can arrange details :)

@ericsysmin
Copy link
Contributor

Is it possible we schedule a meeting for like 30 minutes so we can discuss some items?

We can give it a shot, hit me up on [email protected] so we can arrange details :)

Sent.

@sky-joker
Copy link
Contributor

I'm sorry for leaving everything to you two. I appreciate it.

@ericsysmin
Copy link
Contributor

@sky-joker the meeting was for everyone so we can also be on the same page. I was going to leave it to D3Defi to schedule as this is both of your repo. I'm just contributing.

@D3DeFi D3DeFi assigned dj-wasabi and unassigned ericsysmin Aug 8, 2020
@D3DeFi
Copy link
Contributor Author

D3DeFi commented Aug 8, 2020

@D3DeFi D3DeFi added the role The issue or pull request is related to Zabbix role label Aug 8, 2020
@D3DeFi
Copy link
Contributor Author

D3DeFi commented Dec 23, 2020

Already done

@D3DeFi D3DeFi closed this as completed Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request role The issue or pull request is related to Zabbix role
Projects
None yet
Development

No branches or pull requests

4 participants