diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bf858f6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,65 @@ +--- +name: CI +'on': + pull_request: + push: + branches: + - master + schedule: + - cron: "0 5 * * 0" + +defaults: + run: + working-directory: 'supertarto.wikijs' + +jobs: + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + with: + path: 'supertarto.wikijs' + + - name: Set up Python 3. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: pip3 install yamllint ansible-lint + + - name: Lint code. + run: | + yamllint . + ansible-lint + molecule: + name: Molecule + runs-on: ubuntu-latest + strategy: + matrix: + distrib: + - debian10:latest + + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + with: + path: 'supertarto.wikijs' + + - name: Set up Python 3. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: pip3 install ansible molecule[docker] docker + + - name: Run Molecule tests. + run: molecule test + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + MOLECULE_DISTRIB: ${{ matrix.distrib }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1a18a28..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -language: python -services: docker - -env: - global: - - ROLE_NAME: wikijs - matrix: - - MOLECULE_DISTRIB: debian10:latest - -before_install: - - curl https://gist.githubusercontent.com/supertarto/e9b6a648f07c4e2776cb00a10aa4a697/raw/d58d5104e71d808c64ad38214ae084628eda2f67/travis-ci-molecule.sh | sudo bash - - -install: - - pip install molecule[docker] yamllint ansible-lint docker - -before_script: - - cd ../ - - mv ansible-$ROLE_NAME supertarto.$ROLE_NAME - - cd supertarto.$ROLE_NAME - -script: - - molecule test - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/README.md b/README.md index 55639d3..a530337 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Ansible Wiki.js -[![Build Status](https://travis-ci.com/supertarto/ansible-wikijs.svg?branch=master)](https://travis-ci.com/supertarto/ansible-wikijs) +[![CI](https://github.com/supertarto/ansible-wikijs/workflows/CI/badge.svg?event=push)](https://github.com/supertarto/ansible-wikijs/actions?query=workflow%3ACI) Install and configure Wiki.js with Ansible. diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index db6b475..2bf55d2 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,9 +3,6 @@ dependency: name: galaxy driver: name: docker -lint: | - yamllint . - ansible-lint platforms: - name: instance image: "thetarto/ansible-${MOLECULE_DISTRIB}" @@ -16,3 +13,5 @@ platforms: pre_build_image: true provisioner: name: ansible + playbooks: + converge: ${MOLECULE_PLAYBOOK:-converge.yml}