Skip to content

Commit 391e2e2

Browse files
committed
Dump Travis CI and move to GitHub Actions.
1 parent ac00a63 commit 391e2e2

File tree

8 files changed

+117
-45
lines changed

8 files changed

+117
-45
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: CI
3+
'on':
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "30 3 * * 2"
10+
11+
defaults:
12+
run:
13+
working-directory: 'geerlingguy.varnish'
14+
15+
jobs:
16+
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the codebase.
22+
uses: actions/checkout@v2
23+
with:
24+
path: 'geerlingguy.varnish'
25+
26+
- name: Set up Python 3.
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.x'
30+
31+
- name: Install test dependencies.
32+
run: pip3 install yamllint ansible-lint
33+
34+
- name: Lint code.
35+
run: |
36+
yamllint .
37+
ansible-lint
38+
39+
molecule:
40+
name: Molecule
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
include:
45+
- distro: centos8
46+
playbook: converge.yml
47+
- distro: centos7
48+
playbook: converge.yml
49+
- distro: ubuntu1804
50+
playbook: converge.yml
51+
- distro: debian10
52+
playbook: converge.yml
53+
- distro: centos7
54+
playbook: version-41.yml
55+
56+
steps:
57+
- name: Check out the codebase.
58+
uses: actions/checkout@v2
59+
with:
60+
path: 'geerlingguy.varnish'
61+
62+
- name: Set up Python 3.
63+
uses: actions/setup-python@v2
64+
with:
65+
python-version: '3.x'
66+
67+
- name: Install test dependencies.
68+
run: pip3 install ansible molecule[docker] docker
69+
70+
- name: Run Molecule tests.
71+
run: molecule test
72+
env:
73+
PY_COLORS: '1'
74+
ANSIBLE_FORCE_COLOR: '1'
75+
MOLECULE_DISTRO: ${{ matrix.distro }}
76+
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
3+
# repository or organization.
4+
#
5+
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
6+
# See: https://github.com/ansible/galaxy/issues/46
7+
8+
name: Release
9+
'on':
10+
push:
11+
tags:
12+
- '*'
13+
14+
defaults:
15+
run:
16+
working-directory: 'geerlingguy.varnish'
17+
18+
jobs:
19+
20+
release:
21+
name: Release
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out the codebase.
25+
uses: actions/checkout@v2
26+
with:
27+
path: 'geerlingguy.varnish'
28+
29+
- name: Set up Python 3.
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: '3.x'
33+
34+
- name: Install Ansible.
35+
run: pip3 install ansible-base
36+
37+
- name: Trigger a new import on Galaxy.
38+
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ansible Role: Varnish
22

3-
[![Build Status](https://travis-ci.com/geerlingguy/ansible-role-varnish.svg?branch=master)](https://travis-ci.com/geerlingguy/ansible-role-varnish)
3+
[![CI](https://github.com/geerlingguy/ansible-role-varnish/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-varnish/actions?query=workflow%3ACI)
44

55
Installs the [Varnish HTTP Cache](https://varnish-cache.org/) on RedHat/CentOS or Debian/Ubuntu Linux.
66

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
become: true
55

66
pre_tasks:
7-
- import_tasks: playbook-setup.yml
7+
- import_tasks: setup.yml
88

99
roles:
1010
- role: geerlingguy.varnish

molecule/default/molecule.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ dependency:
33
name: galaxy
44
driver:
55
name: docker
6-
lint: |
7-
set -e
8-
yamllint .
9-
ansible-lint
106
platforms:
117
- name: instance
128
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
File renamed without changes.

molecule/default/playbook-41.yml renamed to molecule/default/version-41.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
varnish_version: "4.1"
88

99
pre_tasks:
10-
- import_tasks: playbook-setup.yml
10+
- import_tasks: setup.yml
1111

1212
roles:
1313
- role: geerlingguy.varnish

0 commit comments

Comments
 (0)