|
| 1 | +name: "ActiveStash: Smoke Test" |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: [ main ] |
| 5 | + push: |
| 6 | + branches: [ main ] |
| 7 | +jobs: |
| 8 | + active-stash-smoke-test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + env: |
| 13 | + BUNDLE_GEMFILE: active_stash_smoke_test.gemfile |
| 14 | + RSPEC_FULL_BACKTRACE: yes |
| 15 | + CS_IDP_CLIENT_SECRET: ${{ secrets.CS_IDP_CLIENT_SECRET }} |
| 16 | + CS_WORKSPACE: ${{ secrets.CS_WORKSPACE }} |
| 17 | + CS_KMS_KEY_ARN: ${{ secrets.CS_KMS_KEY_ARN }} |
| 18 | + CS_NAMING_KEY: ${{ secrets.CS_NAMING_KEY }} |
| 19 | + RAILS_VERSION: 6 |
| 20 | + ACTIVE_STASH_TEST_COLLECTION_PREFIX: run_${{ github.run_number }}.${{ github.run_attempt }} |
| 21 | + PGDATABASE: test |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + repository: cipherstash/activestash |
| 26 | + - name: "Create gemfile" |
| 27 | + # github.head_ref is used for pull_request events and pushes to draft PRs. |
| 28 | + # github.ref_name is used for pushes to open pull requests. |
| 29 | + # https://docs.github.com/en/actions/learn-github-actions/contexts#github-context |
| 30 | + run: | |
| 31 | + cat <<EOF > active_stash_smoke_test.gemfile |
| 32 | + source "https://rubygems.org" |
| 33 | + gemspec |
| 34 | + gem "rails", "~> 6.0.0" |
| 35 | + gem "cipherstash-client", git: "https://github.com/cipherstash/ruby-client", branch: "${{ github.head_ref || github.ref_name }}" |
| 36 | + EOF |
| 37 | + - uses: ruby/setup-ruby@v1 |
| 38 | + with: |
| 39 | + ruby-version: 2.7 |
| 40 | + bundler-cache: false # don't use bundler-cache because we need to run bundle install manually in a later step |
| 41 | + - uses: ankane/setup-postgres@v1 |
| 42 | + with: |
| 43 | + database: ${{ env.PGDATABASE }} |
| 44 | + # Installs GVB so that bundler can resolve the version of cipherstash-client when specified as a Git dependency |
| 45 | + - name: "Install GVB" |
| 46 | + run: gem install git-version-bump |
| 47 | + # Run bundle install now that git-version-bump is available. Normally this is handled by ruby/setup-ruby@v1 |
| 48 | + # with bundler-cache=true |
| 49 | + - name: "Install dependencies" |
| 50 | + run: bundle install |
| 51 | + - name: "Install default uri gem version" |
| 52 | + run: gem install --default -v0.11.0 uri |
| 53 | + - name: Run the tests |
| 54 | + run: bundle exec rake spec |
0 commit comments