Skip to content

Commit

Permalink
ci(github/kitchen): use GitHub Actions for Linux testing [skip ci]
Browse files Browse the repository at this point in the history
* Automated using myii/ssf-formula#298
  • Loading branch information
myii committed Mar 7, 2021
1 parent 28d40b3 commit 1febf87
Show file tree
Hide file tree
Showing 7 changed files with 630 additions and 266 deletions.
166 changes: 166 additions & 0 deletions .github/workflows/kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: 'Kitchen (Linux)'
'on': ['push', 'pull_request']

jobs:
kitchen:
runs-on: 'ubuntu-20.04'
env:
CHANGE_MINIKUBE_NONE_USER: true
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
MINIKUBE_HOME: '$HOME'
KUBECONFIG: '$HOME/.kube/config'
strategy:
fail-fast: false
matrix:
instance:
# - archive-debian-10-tiamat-py3
# - archive-debian-9-tiamat-py3
# - archive-ubuntu-2004-tiamat-py3
# - archive-ubuntu-1804-tiamat-py3
# - archive-ubuntu-1604-tiamat-py3
# - archive-centos-8-tiamat-py3
# - archive-centos-7-tiamat-py3
# - archive-amazonlinux-2-tiamat-py3
# - archive-oraclelinux-8-tiamat-py3
# - archive-oraclelinux-7-tiamat-py3
# - archive-debian-10-master-py3
# - package-debian-10-master-py3
# - clean-debian-10-master-py3
- debian-10-master-py3
# - archive-debian-9-master-py3
# - package-debian-9-master-py3
# - clean-debian-9-master-py3
- debian-9-master-py3
# - archive-ubuntu-2004-master-py3
# - package-ubuntu-2004-master-py3
# - clean-ubuntu-2004-master-py3
- ubuntu-2004-master-py3
# - archive-ubuntu-1804-master-py3
# - package-ubuntu-1804-master-py3
# - clean-ubuntu-1804-master-py3
- ubuntu-1804-master-py3
# - archive-ubuntu-1604-master-py3
# - package-ubuntu-1604-master-py3
# - clean-ubuntu-1604-master-py3
- ubuntu-1604-master-py3
# - archive-centos-8-master-py3
# - package-centos-8-master-py3
# - clean-centos-8-master-py3
- centos-8-master-py3
# - archive-centos-7-master-py3
# - package-centos-7-master-py3
# - clean-centos-7-master-py3
- centos-7-master-py3
# - archive-fedora-33-master-py3
# - package-fedora-33-master-py3
# - clean-fedora-33-master-py3
- fedora-33-master-py3
# - archive-fedora-32-master-py3
# - package-fedora-32-master-py3
# - clean-fedora-32-master-py3
- fedora-32-master-py3
# - archive-opensuse-leap-152-master-py3
# - package-opensuse-leap-152-master-py3
# - clean-opensuse-leap-152-master-py3
- opensuse-leap-152-master-py3
# - archive-opensuse-tmbl-latest-master-py3
# - package-opensuse-tmbl-latest-master-py3
- clean-opensuse-tmbl-latest-master-py3
# - opensuse-tmbl-latest-master-py3
- archive-amazonlinux-2-master-py3
# - package-amazonlinux-2-master-py3
# - clean-amazonlinux-2-master-py3
# - amazonlinux-2-master-py3
- archive-oraclelinux-8-master-py3
# - package-oraclelinux-8-master-py3
# - clean-oraclelinux-8-master-py3
# - oraclelinux-8-master-py3
- archive-oraclelinux-7-master-py3
# - package-oraclelinux-7-master-py3
# - clean-oraclelinux-7-master-py3
# - oraclelinux-7-master-py3
# - archive-gentoo-stage3-latest-master-py3
# - package-gentoo-stage3-latest-master-py3
# - clean-gentoo-stage3-latest-master-py3
# - gentoo-stage3-latest-master-py3
- archive-gentoo-stage3-systemd-master-py3
# - package-gentoo-stage3-systemd-master-py3
# - clean-gentoo-stage3-systemd-master-py3
# - gentoo-stage3-systemd-master-py3
# - archive-debian-10-3002-2-py3
# - archive-debian-9-3002-2-py3
# - archive-ubuntu-2004-3002-2-py3
# - archive-ubuntu-1804-3002-2-py3
# - archive-ubuntu-1604-3002-2-py3
# - archive-centos-8-3002-2-py3
# - archive-centos-7-3002-2-py3
# - archive-fedora-33-3002-2-py3
# - archive-fedora-32-3002-2-py3
# - archive-opensuse-leap-152-3002-2-py3
# - archive-opensuse-tmbl-latest-3002-2-py3
# - archive-amazonlinux-2-3002-2-py3
# - archive-oraclelinux-8-3002-2-py3
# - archive-oraclelinux-7-3002-2-py3
# - archive-arch-base-latest-3002-2-py3
# - package-arch-base-latest-3002-2-py3
# - clean-arch-base-latest-3002-2-py3
- arch-base-latest-3002-2-py3
# - archive-gentoo-stage3-latest-3002-2-py3
# - archive-gentoo-stage3-systemd-3002-2-py3
# - archive-debian-10-3001-4-py3
# - archive-debian-9-3001-4-py3
# - archive-ubuntu-2004-3001-4-py3
# - archive-ubuntu-1804-3001-4-py3
# - archive-ubuntu-1604-3001-4-py3
# - archive-centos-8-3001-4-py3
# - archive-centos-7-3001-4-py3
# - archive-fedora-33-3001-4-py3
# - archive-fedora-32-3001-4-py3
# - archive-opensuse-leap-152-3001-4-py3
# - archive-opensuse-tmbl-latest-3001-4-py3
# - archive-amazonlinux-2-3001-4-py3
# - archive-oraclelinux-8-3001-4-py3
# - archive-oraclelinux-7-3001-4-py3
# - archive-arch-base-latest-3001-4-py3
# - archive-gentoo-stage3-latest-3001-4-py3
# - archive-gentoo-stage3-systemd-3001-4-py3
# - archive-debian-10-3000-6-py3
# - archive-debian-9-3000-6-py3
# - archive-ubuntu-1804-3000-6-py3
# - archive-ubuntu-1604-3000-6-py3
# - archive-centos-8-3000-6-py3
# - archive-centos-7-3000-6-py3
# - archive-opensuse-leap-152-3000-6-py3
# - archive-amazonlinux-2-3000-6-py3
# - archive-oraclelinux-8-3000-6-py3
# - archive-oraclelinux-7-3000-6-py3
# - archive-gentoo-stage3-latest-3000-6-py3
# - archive-gentoo-stage3-systemd-3000-6-py3
# - archive-ubuntu-1804-3000-6-py2
# - archive-ubuntu-1604-3000-6-py2
# - archive-arch-base-latest-3000-6-py2
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: |
${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: "${{ runner.os }}-gems-"
- name: 'Install Bundler'
run: |
sudo gem install bundler \
-v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" \
--quiet --no-document
- name: 'Run Bundler'
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen verify ${{ matrix.instance }}'
env:
CHEF_LICENSE: 'accept-no-persist'
131 changes: 0 additions & 131 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,20 @@
# `stage`
stage_lint: &stage_lint 'lint'
stage_release: &stage_release 'release'
stage_test: &stage_test 'test'
# `image`
image_commitlint: &image_commitlint 'myii/ssf-commitlint:11'
image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
image_precommit: &image_precommit
name: 'myii/ssf-pre-commit:2.9.2'
entrypoint: ['/bin/bash', '-c']
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest'
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14'
# `services`
services_docker_dind: &services_docker_dind
- 'docker:dind'
# `variables`
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
# https://bundler.io/v1.16/bundle_config.html
variables_bundler: &variables_bundler
BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
BUNDLE_WITHOUT: 'production'
# `cache`
cache_bundler: &cache_bundler
key: '${CI_JOB_STAGE}'
paths:
- '${BUNDLE_CACHE_PATH}'

###############################################################################
# Define stages and global variables
###############################################################################
stages:
- *stage_lint
- *stage_test
- *stage_release
variables:
DOCKER_DRIVER: 'overlay2'

###############################################################################
# `lint` stage: `commitlint` & `pre-commit`
Expand Down Expand Up @@ -99,118 +80,6 @@ rubocop:
script:
- 'rubocop -d -P -S --enable-pending-cops'

###############################################################################
# Define `test` template
###############################################################################
.test_instance:
stage: *stage_test
image: *image_dindruby
services: *services_docker_dind
variables: *variables_bundler
cache: *cache_bundler
before_script:
# TODO: This should work from the env vars above automatically
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
- 'bundle config set without "${BUNDLE_WITHOUT}"'
- 'bundle install'
script:
# Alternative value to consider: `${CI_JOB_NAME}`
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'

###############################################################################
# `test` stage: each instance below uses the `test` template above
###############################################################################
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
# archive-debian-10-master-py3: {extends: '.test_instance'}
# package-debian-10-master-py3: {extends: '.test_instance'}
# clean-debian-10-master-py3: {extends: '.test_instance'}
# archive-ubuntu-1804-master-py3: {extends: '.test_instance'}
# package-ubuntu-1804-master-py3: {extends: '.test_instance'}
# clean-ubuntu-1804-master-py3: {extends: '.test_instance'}
# archive-centos-8-master-py3: {extends: '.test_instance'}
# package-centos-8-master-py3: {extends: '.test_instance'}
# clean-centos-8-master-py3: {extends: '.test_instance'}
# archive-fedora-31-master-py3: {extends: '.test_instance'}
# package-fedora-31-master-py3: {extends: '.test_instance'}
# clean-fedora-31-master-py3: {extends: '.test_instance'}
# archive-opensuse-leap-151-master-py3: {extends: '.test_instance'}
# package-opensuse-leap-151-master-py3: {extends: '.test_instance'}
# clean-opensuse-leap-151-master-py3: {extends: '.test_instance'}
# archive-amazonlinux-2-master-py3: {extends: '.test_instance'}
# package-amazonlinux-2-master-py3: {extends: '.test_instance'}
# clean-amazonlinux-2-master-py3: {extends: '.test_instance'}
# archive-debian-10-2019-2-py3: {extends: '.test_instance'}
# package-debian-10-2019-2-py3: {extends: '.test_instance'}
# clean-debian-10-2019-2-py3: {extends: '.test_instance'}
# archive-debian-9-2019-2-py3: {extends: '.test_instance'}
# package-debian-9-2019-2-py3: {extends: '.test_instance'}
# clean-debian-9-2019-2-py3: {extends: '.test_instance'}
# archive-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
# package-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
# clean-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
# archive-centos-8-2019-2-py3: {extends: '.test_instance'}
# package-centos-8-2019-2-py3: {extends: '.test_instance'}
# clean-centos-8-2019-2-py3: {extends: '.test_instance'}
# archive-fedora-31-2019-2-py3: {extends: '.test_instance'}
# package-fedora-31-2019-2-py3: {extends: '.test_instance'}
# clean-fedora-31-2019-2-py3: {extends: '.test_instance'}
# archive-opensuse-leap-151-2019-2-py3: {extends: '.test_instance'}
# package-opensuse-leap-151-2019-2-py3: {extends: '.test_instance'}
# clean-opensuse-leap-151-2019-2-py3: {extends: '.test_instance'}
# archive-centos-7-2019-2-py2: {extends: '.test_instance'}
# package-centos-7-2019-2-py2: {extends: '.test_instance'}
# clean-centos-7-2019-2-py2: {extends: '.test_instance'}
# archive-amazonlinux-2-2019-2-py3: {extends: '.test_instance'}
# package-amazonlinux-2-2019-2-py3: {extends: '.test_instance'}
# clean-amazonlinux-2-2019-2-py3: {extends: '.test_instance'}
# archive-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# package-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# clean-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# archive-fedora-30-2018-3-py3: {extends: '.test_instance'}
# package-fedora-30-2018-3-py3: {extends: '.test_instance'}
# clean-fedora-30-2018-3-py3: {extends: '.test_instance'}
# archive-debian-9-2018-3-py2: {extends: '.test_instance'}
# package-debian-9-2018-3-py2: {extends: '.test_instance'}
# clean-debian-9-2018-3-py2: {extends: '.test_instance'}
# archive-ubuntu-1604-2018-3-py2: {extends: '.test_instance'}
# package-ubuntu-1604-2018-3-py2: {extends: '.test_instance'}
# clean-ubuntu-1604-2018-3-py2: {extends: '.test_instance'}
# archive-centos-7-2018-3-py2: {extends: '.test_instance'}
# package-centos-7-2018-3-py2: {extends: '.test_instance'}
# clean-centos-7-2018-3-py2: {extends: '.test_instance'}
# archive-opensuse-leap-151-2018-3-py2: {extends: '.test_instance'}
# package-opensuse-leap-151-2018-3-py2: {extends: '.test_instance'}
# clean-opensuse-leap-151-2018-3-py2: {extends: '.test_instance'}
# archive-amazonlinux-1-2018-3-py2: {extends: '.test_instance'}
# package-amazonlinux-1-2018-3-py2: {extends: '.test_instance'}
# clean-amazonlinux-1-2018-3-py2: {extends: '.test_instance'}
# archive-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# package-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# clean-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# archive-debian-8-2017-7-py2: {extends: '.test_instance'}
# package-debian-8-2017-7-py2: {extends: '.test_instance'}
# clean-debian-8-2017-7-py2: {extends: '.test_instance'}
# archive-ubuntu-1604-2017-7-py2: {extends: '.test_instance'}
# package-ubuntu-1604-2017-7-py2: {extends: '.test_instance'}
# clean-ubuntu-1604-2017-7-py2: {extends: '.test_instance'}
# archive-centos-6-2017-7-py2: {extends: '.test_instance'}
# package-centos-6-2017-7-py2: {extends: '.test_instance'}
# clean-centos-6-2017-7-py2: {extends: '.test_instance'}
# archive-fedora-30-2017-7-py2: {extends: '.test_instance'}
# package-fedora-30-2017-7-py2: {extends: '.test_instance'}
# clean-fedora-30-2017-7-py2: {extends: '.test_instance'}
# archive-opensuse-leap-151-2017-7-py2: {extends: '.test_instance'}
# package-opensuse-leap-151-2017-7-py2: {extends: '.test_instance'}
# clean-opensuse-leap-151-2017-7-py2: {extends: '.test_instance'}
# archive-amazonlinux-1-2017-7-py2: {extends: '.test_instance'}
# package-amazonlinux-1-2017-7-py2: {extends: '.test_instance'}
# clean-amazonlinux-1-2017-7-py2: {extends: '.test_instance'}
# archive-arch-base-latest-2017-7-py2: {extends: '.test_instance'}
# package-arch-base-latest-2017-7-py2: {extends: '.test_instance'}
# clean-arch-base-latest-2017-7-py2: {extends: '.test_instance'}

###############################################################################
# `release` stage: `semantic-release`
###############################################################################
Expand Down

0 comments on commit 1febf87

Please sign in to comment.