Skip to content

Commit 86db6e4

Browse files
authored
Merge pull request #219 from github/ahayworth-patch-1
Try again
2 parents b0f800b + 8cf9abb commit 86db6e4

File tree

3 files changed

+131
-81
lines changed

3 files changed

+131
-81
lines changed

.dockerignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
*.rbc
2+
/.config
3+
/coverage/
4+
/InstalledFiles
5+
/pkg/
6+
/spec/reports/
7+
/spec/examples.txt
8+
/test/tmp/
9+
/test/version_tmp/
10+
/tmp/
11+
12+
# Used by dotenv library to load environment variables.
13+
# .env
14+
15+
## Specific to RubyMotion:
16+
.dat*
17+
.repl_history
18+
build/
19+
*.bridgesupport
20+
build-iPhoneOS/
21+
build-iPhoneSimulator/
22+
23+
## Specific to RubyMotion (use of CocoaPods):
24+
#
25+
# We recommend against adding the Pods directory to your .gitignore. However
26+
# you should judge for yourself, the pros and cons are mentioned at:
27+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
28+
#
29+
# vendor/Pods/
30+
31+
## Documentation cache and generated files:
32+
/.yardoc/
33+
/_yardoc/
34+
/rdoc/
35+
36+
## Environment normalization:
37+
/.bundle/
38+
/vendor/bundle
39+
/lib/bundler/man/
40+
41+
# for a library or gem, you might want to ignore these files since the code is
42+
# intended to run in multiple environments; otherwise, check them in:
43+
# Gemfile.lock
44+
# .ruby-version
45+
# .ruby-gemset
46+
47+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
48+
.rvmrc
49+
50+
# Specifics for octocatalog-diff
51+
bin/bundler
52+
bin/facter
53+
bin/hiera
54+
bin/htmldiff
55+
bin/httparty
56+
bin/ldiff
57+
bin/parallel_cucumber
58+
bin/parallel_rspec
59+
bin/parallel_spinach
60+
bin/parallel_test
61+
bin/puppet
62+
bin/rake
63+
bin/rspec
64+
bin/rubocop
65+
bin/ruby-parse
66+
bin/ruby-rewrite
67+
bin/safe_yaml
68+
69+
# Ignore config created during testing
70+
.puppet_version
71+
.parallel_runtime_rspec.log
72+
.parallel_runtime_integration.log
73+
.parallel_runtime_tests.log
74+
.rspec_parallel
75+
76+
# Packaged gem
77+
/pkg/
78+
Gemfile.lock
79+
80+
.git

.github/workflows/main.yml

Lines changed: 33 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,109 +2,61 @@ name: CI
22
on: [push]
33
jobs:
44
puppet-3-8-7:
5+
env:
6+
PUPPET_VERSIONS: "3.8.7"
7+
PUPPET_VERSION: "3.8.7"
8+
RUBOCOP_TEST: false
9+
RSPEC_TEST: true
510
runs-on: ubuntu-latest
611
strategy:
712
matrix:
813
ruby-version: ["2.0", "2.1"]
914
steps:
1015
- name: Checkout code
1116
uses: actions/checkout@v1
12-
- name: bundle
13-
run: |
14-
apt-get update
15-
apt-get install -y cmake openssl libssl-dev
16-
echo "3.8.7" > .puppet_version
17-
bundle install --binstubs --jobs 4 --retry 3
18-
- name: rspec
19-
run: |
20-
bundle exec rspec spec/octocatalog-diff/tests
21-
bundle exec rspec spec/octocatalog-diff/integration
22-
container:
23-
image: ruby:${{matrix.ruby-version}}
24-
env:
25-
PUPPET_VERSION: "3.8.7"
17+
- name: Build container
18+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
19+
- name: Tests
20+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
2621

2722
puppet-4-10-10:
23+
env:
24+
PUPPET_VERSIONS: "4.10.10"
25+
PUPPET_VERSION: "4.10.10"
26+
RUBOCOP_TEST: false
27+
RSPEC_TEST: true
2828
runs-on: ubuntu-latest
2929
strategy:
3030
matrix:
3131
ruby-version: ["2.1", "2.2", "2.3"]
3232
steps:
3333
- name: Checkout code
3434
uses: actions/checkout@v1
35-
- name: bundle
36-
run: |
37-
apt-get update
38-
apt-get install -y cmake openssl libssl-dev
39-
echo "4.10.10" > .puppet_version
40-
bundle install --binstubs --jobs 4 --retry 3
41-
- name: spec
42-
run: |
43-
bundle exec rspec spec/octocatalog-diff/tests
44-
bundle exec rspec spec/octocatalog-diff/integration
45-
container:
46-
image: ruby:${{matrix.ruby-version}}
47-
env:
48-
PUPPET_VERSION: "4.10.10"
35+
- name: Build container
36+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
37+
- name: Tests
38+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
4939

5040
puppet-5-5-8:
41+
env:
42+
PUPPET_VERSIONS: "5.5.8"
43+
PUPPET_VERSION: "5.5.8"
44+
RUBOCOP_TEST: false
45+
RSPEC_TEST: true
5146
runs-on: ubuntu-latest
5247
strategy:
5348
matrix:
5449
ruby-version: ["2.4", "2.5", "2.6"]
5550
steps:
5651
- name: Checkout code
5752
uses: actions/checkout@v1
58-
- name: bundle
59-
run: |
60-
apt-get update
61-
apt-get install -y cmake openssl libssl-dev
62-
echo "5.5.8" > .puppet_version
63-
bundle install --binstubs --jobs 4 --retry 3
64-
- name: rspec
65-
run: |
66-
bundle exec rspec spec/octocatalog-diff/tests
67-
bundle exec rspec spec/octocatalog-diff/integration
68-
container:
69-
image: ruby:${{matrix.ruby-version}}
70-
env:
71-
PUPPET_VERSION: "5.5.8"
72-
73-
rubocop:
74-
runs-on: ubuntu-latest
75-
steps:
76-
- name: Checkout code
77-
uses: actions/checkout@v1
78-
- name: bundle
79-
run: |
80-
apt-get update
81-
apt-get install -y cmake openssl libssl-dev
82-
echo "5.5.8" > .puppet_version
83-
bundle install --binstubs --jobs 4 --retry 3
84-
- name: rubocop
85-
run: bundle exec rake rubocop
86-
container:
87-
image: "ruby:2.6"
88-
env:
89-
PUPPET_VERSION: "5.5.8"
90-
91-
coverage:
92-
runs-on: ubuntu-latest
93-
steps:
94-
- name: Checkout code
95-
uses: actions/checkout@v1
96-
- name: bundle
97-
run: |
98-
apt-get update
99-
apt-get install -y cmake openssl libssl-dev
100-
echo "5.5.8" > .puppet_version
101-
bundle install --binstubs --jobs 4 --retry 3
102-
- name: rubocop
103-
run: |
104-
bundle exec rspec spec/octocatalog-diff/tests
105-
grep -q "100% test coverage. You're all set, friend" coverage/coverage.txt
106-
container:
107-
image: "ruby:2.6"
108-
env:
109-
PUPPET_VERSION: "5.5.8"
110-
COVERAGE: true
53+
- name: Build container
54+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
55+
- name: Tests
56+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
57+
- name: Rubocop and Coverage
58+
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
59+
if: matrix.ruby-version == '2.6'
60+
env:
61+
RUBOCOP_TEST: true
62+
ENFORCE_COVERAGE: true

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG RUBY_VERSION="2.6"
2+
FROM ruby:${RUBY_VERSION} as ruby
3+
ARG RUBY_VERSION
4+
ENV RUBY_VERSION="${RUBY_VERSION}"
5+
RUN rm -rf $GEM_HOME $BUNDLE_PATH $BUNDLE_BIN $BUNDLE_APP_CONFIG
6+
RUN apt-get update && apt-get install -y cmake openssl libssl-dev
7+
RUN sed -i'' -e 's/CipherString = DEFAULT@SECLEVEL=2/CipherString = DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
8+
RUN sed -i'' -e 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
9+
10+
FROM scratch AS app
11+
COPY --from=ruby / /
12+
WORKDIR /app
13+
ENV LANG="C.UTF-8"
14+
COPY . .
15+
#RUN gem install bundler -v 1.17.2
16+
RUN script/bootstrap
17+
18+
CMD ["/app/script/cibuild"]

0 commit comments

Comments
 (0)