--- name: Continuous Integration on: push: branches-ignore: - refs/tags/*_staging - refs/tags/*_production jobs: build: runs-on: ubuntu-18.04 steps: - name: Checkout branch uses: actions/checkout@v2 - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Set up Ruby uses: actions/setup-ruby@v1.1.1 with: ruby-version: 2.6.6 - name: Cache gems uses: actions/cache@v1 with: path: vendor/bundle key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/clean-architecture.gemspec') }}" restore-keys: "${{ runner.OS }}-gem-cache-\n" - name: Install bundler run: (bundler -v | grep "2.1.4") || gem install bundler:2.1.4 - name: Install gems run: bundle install --jobs $(nproc) --retry 3 --without metrics --path vendor/bundle - name: Create cache directory run: mkdir -p tmp/cache - name: Typecheck with Sorbet run: bundle exec srb tc . --ignore=/vendor - name: Run RSpec test suite run: bundle exec rspec spec env: METRICS: '1' - name: Post to Slack if build fails if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stable') uses: pullreminders/slack-action@master env: SLACK_BOT_TOKEN: "${{ secrets.SLACK_BOT_TOKEN }}" with: args: '{\"channel\":\"C33574SJJ\",\"text\":\"* ${{ github.repository }} BUILD FAILURE*\", \"attachments\": [{ \"fallback\": \"Failure summary\", \"color\": \"#ff0000\", \"fields\": [{\"title\": \"Branch\", \"value\":\"${{ steps.extract_branch.outputs.branch }}\"}, {\"title\": \"Who broke it\", \"value\":\"${{ github.actor }}\"}, { \"title\": \"Build output\", \"value\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks\", \"short\": false }]}]}'