diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 019bb51..cb89e5e 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -14,68 +14,6 @@ jobs: timeout-minutes: 3 steps: - uses: actions/checkout@v3 - - name: setup ruby version and foobara branch and sha1 - run: | - foobara_entry=`grep -A2 -m 1 ' remote: foobara$' Gemfile.lock` - regex="revision: ([0-9a-f]+)\s+branch: ([-_[:alnum:]]+)$" - - if [[ $foobara_entry =~ $regex ]]; then - foobara_sha1="${BASH_REMATCH[1]}" - foobara_branch="${BASH_REMATCH[2]}" - - echo foobara_sha1=$foobara_sha1 >> "$GITHUB_ENV" - echo foobara_branch=$foobara_branch >> "$GITHUB_ENV" - else - echo "$foobara_entry doesn't match $regex" >&2 - fi - - echo ruby_version=`cat .ruby-version` >> "$GITHUB_ENV" - - name: cache foobara - id: cache-foobara - uses: actions/cache@v3 - env: - cache-name: cache-foobara - with: - path: ~/work/typescript-remote-command-generator/foobara - key: ${{ env.cache-name }}-${{ env.foobara_branch }}-${{ env.foobara_sha1 }} - restore-keys: | - ${{ env.cache-name }}-${{ env.foobara_branch }}- - ${{ env.cache-name }}- - - if: ${{ steps.cache-foobara.outputs.cache-hit != 'true' }} - name: clone or pull foobara - run: | - set -e - cd .. - if [ -d foobara ]; then - echo pulling - cd foobara - ssh-agent sh -c 'echo "${{ secrets.TYPESCRIPT_REMOTE_COMMAND_GENERATOR_KEY_FOR_FOOBARA }}" | ssh-add - && - git fetch --depth=1 origin $foobara_sha1 && - if git rev-parse --verify -q $foobara_branch; then - git checkout -q $foobara_branch - git reset --hard $foobara_sha1 - else - git branch $foobara_branch $foobara_sha1 - git checkout -q $foobara_branch - fi' - else - echo cloning - ssh-agent sh -c 'echo "${{ secrets.TYPESCRIPT_REMOTE_COMMAND_GENERATOR_KEY_FOR_FOOBARA }}" | ssh-add - && - git clone -b $foobara_branch --depth=1 git@github.com:foobara/foobara.git' - fi - - - name: symlink foobara and point bundler at it - run: | - set -e - mkdir -p .bundle - echo -e "---\nBUNDLE_LOCAL__FOOBARA: '/home/runner/work/typescript-remote-command-generator/foobara'" > .bundle/config - mkdir ../../foobara - ln -s ../../typescript-remote-command-generator/foobara ../../foobara/foobara - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ env.ruby_version }} - bundler-cache: true - name: Run rspec run: bundle exec rspec # - name: Upload coverage directory