-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert hashicorp/vault-rails to GitHub Actions (#130)
* Add workflow hashicorp/vault-rails/run-tests * SHA-pin all 3rd-party actions * Restrict workflow permissions * Add actionslint * Add dependabot * Add CODEOWNERS * Replace deprecated references * lets try it first Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * Remove circleci Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * split to different steps Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * try with ruby2 Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * Update run-tests.yml * parser can't handle anchors/aliases Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> * skip failing tests for now Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> --------- Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com> Co-authored-by: Daniel Huckins <dhuckins@users.noreply.github.com>
- Loading branch information
1 parent
8172103
commit 5d22355
Showing
8 changed files
with
121 additions
and
162 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# If the repository is public, be sure to change to GitHub hosted runners | ||
name: Lint GitHub Actions Workflows | ||
on: | ||
push: | ||
pull_request: | ||
permissions: | ||
contents: read | ||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
- name: "Check workflow files" | ||
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: hashicorp/vault-rails/run-tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# https://endoflife.date/ruby | ||
ruby: ["2.7", "3.0", "3.1", "3.2"] | ||
vault: ["1.11.9", "1.12.5", "1.13.1"] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: "Install vault cli" | ||
run: | | ||
curl -sLo vault.zip "https://releases.hashicorp.com/vault/${{ matrix.vault }}/vault_${{ matrix.vault }}_linux_amd64.zip" | ||
unzip vault.zip | ||
mkdir -p "$HOME/bin" | ||
mv vault "$HOME/bin" | ||
echo "$HOME/bin" >> "$GITHUB_PATH" | ||
- name: "Setup tests" | ||
run: | | ||
bundle exec rake app:db:create | ||
bundle exec rake app:db:schema:load | ||
bundle exec rake app:db:test:prepare | ||
gem uninstall sqlite3 | ||
- name: "Run tests" | ||
run: bundle exec rake spec | ||
|
||
permissions: | ||
contents: read |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Submit a helpdesk ticket to add any team other than yours referenced in the CODEOWNERS file -- they must be added to collaborators and teams in the repository settings with maintainer privileges. Remove this file as soon as you have completed this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
default: &default | ||
development: | ||
adapter: sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
development: | ||
<<: *default | ||
database: db/development.sqlite3 | ||
|
||
test: | ||
<<: *default | ||
adapter: sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
database: db/test.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters