Skip to content

Commit

Permalink
Dry up CI workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Feb 24, 2024
1 parent a8a3699 commit ab1ae47
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 92 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
workflow_call:
inputs:
crystal-version:
required: true
type: string

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ inputs.crystal-version }}

- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
49 changes: 3 additions & 46 deletions .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,6 @@ on:

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: nightly

- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
uses: ./.github/workflows/ci-base.yml
with:
crystal-version: nightly
49 changes: 3 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,6 @@ on:

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest

- name: Download source
uses: actions/checkout@v4

- name: Install dependencies
run: shards install

- name: Run specs
run: crystal spec --error-on-warnings --error-trace

- name: Build the binary
run: shards build --error-on-warnings --error-trace

- name: Run core specs (Firefox)
working-directory: ./core/tests
run: ../../bin/mint test -b firefox

- name: Run core specs (Google Chrome)
working-directory: ./core/tests
run: ../../bin/mint test -b chrome

- name: Check formatting (Mint)
working-directory: ./core
run: ../bin/mint format --check

- name: Check formatting (Mint tests)
working-directory: ./core/tests
run: ../../bin/mint format --check

- name: Check formatting (Crystal)
run: crystal tool format --check

- name: Run ameba
run: bin/ameba
uses: ./.github/workflows/ci-base.yml
with:
crystal-version: latest

0 comments on commit ab1ae47

Please sign in to comment.