-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 IMPROVE: Update to Github Actions (#5)
- Loading branch information
1 parent
921765a
commit 0a1a0e4
Showing
18 changed files
with
221 additions
and
102 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# use `# noqa xxx` at the end of a line, to ignore a particular error | ||
# or add to the warn_list, to ignore for the whole project | ||
warn_list: ['208'] |
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,72 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
env: | ||
galaxy-name: "marvel-nccr.cp2k" | ||
|
||
jobs: | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- uses: pre-commit/[email protected] | ||
|
||
molecule: | ||
|
||
strategy: | ||
matrix: | ||
distro: [ubuntu1604, ubuntu1804, ubuntu2004] | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.galaxy-name }} | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --upgrade pip | ||
pip --version | ||
- name: Install requirements | ||
run: | | ||
pip install wheel | ||
pip install -r requirements.txt | ||
working-directory: ${{ env.galaxy-name }} | ||
|
||
- name: Run molecule | ||
run: molecule test | ||
working-directory: ${{ env.galaxy-name }} | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} | ||
|
||
release: | ||
name: Publish to ansible-galaxy | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
needs: [pre-commit, molecule] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: robertdebock/[email protected] | ||
with: | ||
galaxy_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
*.swp | ||
.DS_Store | ||
.galaxy_install_info | ||
.vscode/ | ||
.tox/ |
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,19 @@ | ||
# For use with pre-commit. | ||
# See usage instructions at https://pre-commit.com | ||
repos: | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v1.5.0 | ||
hooks: | ||
- id: pretty-format-yaml | ||
args: [--autofix, --indent, "2", --preserve-quotes] | ||
|
||
- repo: https://github.com/adrienverge/yamllint | ||
rev: v1.25.0 | ||
hooks: | ||
- id: yamllint | ||
|
||
- repo: https://github.com/ansible/ansible-lint | ||
rev: v4.3.5 | ||
hooks: | ||
- id: ansible-lint |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
extends: default | ||
rules: | ||
document-start: disable | ||
line-length: | ||
max: 200 | ||
level: warning | ||
indentation: | ||
spaces: 2 | ||
indent-sequences: false |
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
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
become: true | ||
apt: update_cache=yes cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
- name: Update apt cache. | ||
become: true | ||
apt: update_cache=yes cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
|
||
vars: | ||
- run_tests: true | ||
- cloud_platform: docker | ||
- run_tests: true | ||
- cloud_platform: docker | ||
|
||
roles: | ||
- role: marvel-nccr.cp2k | ||
- role: marvel-nccr.cp2k |
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 |
---|---|---|
@@ -1,21 +1,29 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
# requirements_file: molecule/default/requirements.yml | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
platforms: | ||
- name: instance | ||
image: "${DOCKER_IMAGE:-marvelnccr/ubuntu-docker-base}:${DOCKER_IMAGE_VERSION:-latest}" | ||
command: "${DOCKER_COMMAND:-sleep infinity}" | ||
privileged: true | ||
pre_build_image: true | ||
- name: instance | ||
image: "marvelnccr/docker-${MOLECULE_DISTRO:-ubuntu1804}-ansible:latest" | ||
# by default the container will initialise with systemd as PID1 | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
env: | ||
LC_ALL: "en_US.UTF-8" | ||
LANG: "en_US.UTF-8" | ||
provisioner: | ||
name: ansible | ||
options: | ||
v: true | ||
# log: true # use for debugging | ||
playbooks: | ||
converge: converge.yml | ||
config_options: | ||
defaults: | ||
# nicer stdout printing | ||
stdout_callback: yaml | ||
bin_ansible_callbacks: true | ||
# add timing to tasks | ||
callback_whitelist: profile_tasks |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
molecule~=3.0 | ||
docker | ||
yamllint | ||
ansible-lint | ||
# for running | ||
ansible~=2.10.0 | ||
# for testing | ||
molecule[docker]~=3.1.0 | ||
docker~=4.2 |
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
Oops, something went wrong.