CI #1663
This file contains hidden or 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: CI | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: [ main, master ] | |
push: | |
branches: [ main, master ] | |
schedule: | |
- cron: '0 1 * * *' | |
permissions: | |
contents: read | |
jobs: | |
specs: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: diffend | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- '3.4' | |
- '3.3' | |
- '3.2' | |
- '3.1' | |
include: | |
- ruby: '3.4' | |
coverage: 'true' | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Install package dependencies | |
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS" | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@c95ae3725f6ebdd095f2bd19caed7ebc14435ba5 # v1.243.0 | |
with: | |
ruby-version: ${{matrix.ruby}} | |
bundler: 'latest' | |
- name: Install latest bundler | |
run: | | |
gem install bundler --no-document | |
gem update --system --no-document | |
bundle config set without 'tools benchmarks docs' | |
- name: Bundle install | |
run: | | |
bundle config set without development | |
bundle install --jobs 4 --retry 3 | |
- name: Run all tests | |
env: | |
GITHUB_COVERAGE: ${{matrix.coverage}} | |
run: bundle exec rspec | |
diffend: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@c95ae3725f6ebdd095f2bd19caed7ebc14435ba5 # v1.243.0 | |
with: | |
ruby-version: 3.4 | |
- name: Install latest bundler | |
run: gem install bundler --no-document | |
- name: Install Diffend plugin | |
run: bundle plugin install diffend | |
- name: Bundle Secure | |
run: bundle secure | |
coditsu: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Download Coditsu script | |
run: | | |
curl -sSL https://api.coditsu.io/run/ci -o coditsu_script.sh | |
chmod +x coditsu_script.sh | |
- name: Verify Coditsu script checksum | |
run: | | |
EXPECTED_SHA256="0aecc5aa010f53fca264548a41467a2b0a1208d750ce1da3e98a217304cacbbc" | |
ACTUAL_SHA256=$(sha256sum coditsu_script.sh | awk '{ print $1 }') | |
if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then | |
echo "::error::Checksum verification failed. Expected $EXPECTED_SHA256 but got $ACTUAL_SHA256." | |
exit 1 | |
fi | |
- name: Run Coditsu | |
run: ./coditsu_script.sh |