Merge pull request #979 from MikeMcQuaid/dependabot/bundler/bundler-9… #1536
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
name: GitHub Actions CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
style: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Install shfmt | |
run: brew install shfmt | |
- run: script/style | |
tests: | |
runs-on: macos-14 | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Homebrew to install from API | |
run: echo HOMEBREW_NO_INSTALL_FROM_API= >> "$GITHUB_ENV" | |
- run: brew test-bot --only-cleanup-before | |
- name: Cleanup macOS | |
run: sudo rm -rf /usr/local/bin/brew /usr/local/.??* | |
/usr/local/Homebrew /opt/homebrew | |
/Applications/Xcode.app /usr/local/Caskroom | |
/Library/Developer/CommandLineTools | |
- name: Check installed Xcodes | |
run: ls /Applications/Xcode*.app | |
- name: Use newer Xcode | |
run: sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer | |
- run: bin/strap.sh | |
env: | |
STRAP_CI: 1 | |
STRAP_DEBUG: 1 | |
- name: Rerun bin/strap.sh | |
run: bin/strap.sh | |
env: | |
STRAP_CI: 1 | |
- run: brew config | |
- run: brew doctor | |
- name: Install Ruby dependencies | |
run: brew install gmp openssl libyaml | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- run: script/bootstrap | |
- run: script/tests | |
- run: brew install --build-from-source --formula libfaketime | |
- run: brew install --cask orka | |
- run: brew install --formula xz | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Set RUBY_VERSION | |
run: | | |
set -xeuo pipefail | |
RUBY_VERSION=$(cat .ruby-version) | |
echo "RUBY_VERSION=${RUBY_VERSION}" >> "${GITHUB_ENV}" | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: mikemcquaid | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# We don't give Dependabot access to tokens. | |
- if: github.actor != 'dependabot[bot]' | |
name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: mikemcquaid | |
password: ${{ secrets.DOCKER_TOKEN }} | |
# We don't give Dependabot access to tokens. | |
- if: github.actor != 'dependabot[bot]' | |
name: Login to DigitalOcean | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITAL_OCEAN_TOKEN }} | |
# We don't give Dependabot access to tokens. | |
- if: github.actor != 'dependabot[bot]' | |
run: doctl registry login --expiry-seconds 300 | |
# We don't give Dependabot access to tokens. | |
- if: github.actor != 'dependabot[bot]' | |
run: doctl registry garbage-collection start --include-untagged-manifests --force | |
- uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: | | |
mikemcquaid/strap:latest | |
mikemcquaid/strap:main | |
mikemcquaid/strap:master | |
ghcr.io/mikemcquaid/strap:latest | |
ghcr.io/mikemcquaid/strap:main | |
ghcr.io/mikemcquaid/strap:master | |
registry.digitalocean.com/mikemcquaid/strap:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
RUBY_VERSION=${{ env.RUBY_VERSION }} |