Skip to content

Commit

Permalink
CI: some simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Aug 14, 2023
1 parent 95179d6 commit 729aa1b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 41 deletions.
57 changes: 19 additions & 38 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,55 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
unit-tests:
check:
strategy:
fail-fast: false
matrix:
puppet_version: [7]

name: Check / Puppet ${{ matrix.puppet_version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container: puppet/pdk:latest

steps:
- name: Install build-essential
run: |
export DEBIAN_FRONTEND=noninteractive;
apt-get --yes update
apt-get --yes install build-essential
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Run pdk validate
uses: puppets-epic-show-theatre/action-pdk-validate@v1
with:
puppet-version: ${{ matrix.puppet_version }}
run: pdk validate --format=text --puppet-version ${{ matrix.puppet_version }}

- name: Run pdk test unit
uses: puppets-epic-show-theatre/action-pdk-test-unit@v1
with:
puppet-version: ${{ matrix.puppet_version }}

coverage:
strategy:
fail-fast: false
matrix:
puppet_version: [7]

name: Coverage
runs-on: ubuntu-20.04
needs:
- unit-tests

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Run test coverage
run: |
bundle exec rake spec:simplecov
run: pdk test unit --format=text --puppet-version ${{ matrix.puppet_version }}

acceptance:
strategy:
fail-fast: false
matrix:
os: ['deb10', 'deb11', 'el8', 'rocky8', 'ub2004']
os: ['rocky8', 'ub2204', 'deb11']
puppet_version: [7]

name: Acceptance / ${{ matrix.os }} / Puppet ${{ matrix.puppet_version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs:
- unit-tests
- check

steps:
- name: Enable IPv6 on docker
run: |
echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -90,6 +70,7 @@ jobs:
bundle exec rake 'litmus:install_agent[puppet${{ matrix.puppet_version }}]'
bundle exec rake litmus:install_module
bundle exec rake litmus:acceptance:parallel
- name: Cleanup
run: |
bundle exec rake 'litmus:tear_down'
7 changes: 4 additions & 3 deletions provision.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
default:
provisioner: docker_exp
images: ['litmusimage/centos:8']
vars: '{docker_run_opts: ["-p 8091:80"]}'
images: ['waffleimage/centos7']
vagrant:
provisioner: vagrant
images: ['centos/7', 'generic/ubuntu2004']

deb_all:
provisioner: docker
images: ['litmusimage/debian:10', 'litmusimage/debian:11']
Expand All @@ -19,6 +19,7 @@ el_all:
ub_all:
provisioner: docker
images: ['litmusimage/ubuntu:20.04', 'litmusimage/ubuntu:22.04']

gha_deb10:
provisioner: docker
images: ['litmusimage/debian:10']
Expand All @@ -45,7 +46,7 @@ gha_rocky8:
# The most reliable workaround for the docker/systemd incompatibility.
# see https://github.com/docker/for-linux/issues/835
# see https://github.com/moby/moby/issues/38749
vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}'
#vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}'
gha_ub2004:
provisioner: docker
images: ['litmusimage/ubuntu:20.04']
Expand Down

0 comments on commit 729aa1b

Please sign in to comment.