Skip to content

Commit 9b48561

Browse files
authored
Merge pull request #9 from tedconf/1.2.0
1.2.0
2 parents c5e8e0b + 2627be6 commit 9b48561

6 files changed

Lines changed: 25 additions & 24 deletions

File tree

.github/workflows/rails.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ on:
1616

1717
jobs:
1818
integration:
19-
uses: tedconf/github_actions_public/.github/workflows/rails_ci.yml@1.0.2
19+
uses: tedconf/github_actions_public/.github/workflows/rails_ci.yml@1.2.0
2020
secrets: inherit
2121
with:
2222
cve-ignorelist: ${{ inputs.cve-ignorelist }}
2323
ruby-version: ${{ inputs.ruby-version }}
2424

2525
deployment:
2626
needs: integration
27-
uses: tedconf/github_actions_public/.github/workflows/rails_cd.yml@1.0.2
27+
uses: tedconf/github_actions_public/.github/workflows/rails_cd.yml@1.2.0
2828
secrets: inherit

.github/workflows/rails_cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
continuous-deployment:
1212
runs-on: self-hosted
1313
steps:
14-
- uses: tedconf/setup-ruby@1.0.3
14+
- uses: tedconf/setup-ruby@1.1.0
1515
with:
1616
ssh-private-key: ${{ secrets.TEDCONF_GH_ACTIONS_JENKINS_PRIV_SSH_KEY }}
1717
rubygems-key: ${{ secrets.BUNDLE_RUBYGEMS__TED__COM }}

.github/workflows/rails_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ on:
1616

1717
jobs:
1818
static-analyses:
19-
uses: tedconf/github_actions_public/.github/workflows/rails_ci_static_analyses.yml@1.0.2
19+
uses: tedconf/github_actions_public/.github/workflows/rails_ci_static_analyses.yml@1.2.0
2020
secrets: inherit
2121
with:
2222
cve-ignorelist: ${{ inputs.cve-ignorelist }}
2323
ruby-version: ${{ inputs.ruby-version }}
2424
specs:
25-
uses: tedconf/github_actions_public/.github/workflows/rails_ci_tests.yml@1.0.2
25+
uses: tedconf/github_actions_public/.github/workflows/rails_ci_tests.yml@1.2.0
2626
secrets: inherit
2727
with:
2828
ruby-version: ${{ inputs.ruby-version }}

.github/workflows/rails_ci_static_analyses.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
static-analyses:
1919
runs-on: self-hosted
2020
steps:
21-
- uses: tedconf/setup-ruby@1.0.3
21+
- uses: tedconf/setup-ruby@1.1.0
2222
with:
2323
ssh-private-key: ${{ secrets.TEDCONF_GH_ACTIONS_JENKINS_PRIV_SSH_KEY }}
2424
rubygems-key: ${{ secrets.BUNDLE_RUBYGEMS__TED__COM }}
@@ -34,12 +34,11 @@ jobs:
3434
run: bundle exec bundler-audit
3535
- name: Check brakeman requirement
3636
shell: bash
37-
id: brakeman
3837
# We grep the Gemfile because ruby gems don't have Gemfile.lock
3938
run: |
40-
echo "::set-output name=references::$(grep brakeman Gemfile | wc -l)"
39+
echo "brakeman_count=$(grep brakeman Gemfile | wc -l)" >> $GITHUB_ENV
4140
- name: Scan code for vulnerabilities
42-
if: steps.brakeman.outputs.references > 0
41+
if: env.brakeman_count > 0
4342
run: |
4443
bundle exec brakeman -q -w2
4544
- name: Run rubocop linters

.github/workflows/rails_ci_tests.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,63 +16,61 @@ jobs:
1616
RAILS_ENV: test
1717
DATABASE_URL: 'mysql2://127.0.0.1' # shogo82148/actions-setup-mysql@v1 doesn't work with socket
1818
steps:
19-
- uses: tedconf/setup-ruby@1.0.3
19+
- uses: tedconf/setup-ruby@1.1.0
2020
with:
2121
ssh-private-key: ${{ secrets.TEDCONF_GH_ACTIONS_JENKINS_PRIV_SSH_KEY }}
2222
rubygems-key: ${{ secrets.BUNDLE_RUBYGEMS__TED__COM }}
2323
ruby-version: ${{ inputs.ruby-version }}
2424
- name: Check for coyote gem
2525
shell: bash
26-
id: coyote
2726
run: |
28-
echo "::set-output name=count::$(grep coyote Gemfile.lock | wc -l)"
27+
echo "coyote_count=$(grep coyote Gemfile.lock | wc -l)" >> $GITHUB_ENV
2928
- name: Configure sysctl limits on localhost to be able to run Elasticsearch
3029
# Required to get Elasticsearch container to run on shgar host
3130
shell: bash
32-
if: steps.coyote.outputs.count > 0
31+
if: env.coyote_count > 0
3332
run: |
3433
sudo swapoff -a
3534
sudo sysctl -w vm.swappiness=1
3635
sudo sysctl -w fs.file-max=262144
3736
sudo sysctl -w vm.max_map_count=262144
3837
- name: Setup and start Elasticsearch
3938
uses: tedconf/elasticsearch-github-actions@lee-self_hosted
40-
if: steps.coyote.outputs.count > 0
39+
if: env.coyote_count > 0
4140
with:
4241
stack-version: 6.8.23
4342
plugins: 'analysis-icu analysis-phonetic'
4443

4544
- name: Elasticsearch is reachable
46-
if: steps.coyote.outputs.count > 0
45+
if: env.coyote_count > 0
4746
run: |
4847
curl --verbose --show-error http://localhost:9200
4948
- name: Check if database is needed
50-
id: db
5149
shell: bash
5250
run: |
51+
has_db_yml=0
5352
if [ -f "./config/database.yml" ]; then
54-
echo ::set-output name=required::1
55-
else
56-
echo ::set-output name=required::0
53+
has_db_yml=1
5754
fi
55+
echo "uses_db=$has_db_yml" >> $GITHUB_ENV
5856
5957
- name: Set up test secrets
60-
if: steps.db.outputs.required > 0
58+
if: env.uses_db > 0
6159
run: cp config/secrets.github.yml config/secrets.yml
6260
- name: Setup MySQL
6361
# Workaround for MySQL in ACT until
6462
# https://bugs.launchpad.net/ubuntu/focal/+source/mysql-8.0/+bug/1899248 is
6563
# released
66-
if: steps.db.outputs.required > 0 && env.ACT
64+
if: env.uses_db > 0 && env.ACT
6765
uses: shogo82148/actions-setup-mysql@v1
6866
with:
6967
mysql-version: '8.0'
7068
root-password: root
7169
- name: Start MySQL
72-
if: ${{ steps.db.outputs.required > 0 && !env.ACT }}
70+
if: ${{ env.uses_db > 0 && !env.ACT }}
7371
run: sudo /etc/init.d/mysql start
7472
- name: Create DB
75-
if: steps.db.outputs.required > 0
73+
if: env.uses_db > 0
7674
env:
7775
RAILS_ENV: test
7876
run: |
@@ -83,6 +81,6 @@ jobs:
8381
bundle exec rspec
8482
# prevent accidentally leaking secrets
8583
- name: Remove test secrets
86-
if: steps.db.outputs.required > 0
84+
if: env.uses_db > 0
8785
run: |
8886
rm config/secrets.yml

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.0 (2022-10-13)
2+
- Updates variable syntax per [Github
3+
docs](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/)
4+
15
# 1.1.0 (2022-10-11)
26
- Adds support for ruby gem CI:
37
- Adds conditionals for:

0 commit comments

Comments
 (0)