Implement clock in ruby #251
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: Test exercises | |
on: | |
push: | |
branches: [main] | |
env: | |
bats-version: '1.10.0' | |
clojure-version: '1.10.3.1093' | |
cmake-version: '3.27.7' | |
dart-version: '2.19.6' | |
elixir-version: '1.15.6' | |
erlang-version: '26.1' | |
ghc-version: '8.10.7' | |
gleam-version: '0.31.0' | |
lua-version: '5.4.6' | |
lua-rocks-version: '3.9.2' | |
jq-version: '1.7' | |
node-version: '18.18.0' | |
python-version: '3.12.0' | |
rebar3-version: '3.22.1' | |
ruby-version: '3.2.2' | |
stack-version: '2.13.1' | |
zig-version: '0.11.0' | |
jobs: | |
test-clojure: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
clojure/** | |
clojure-tests.sh | |
- name: "Prepare java" | |
uses: actions/setup-java@v3 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: "Setup Clojure" | |
uses: DeLaGuardo/[email protected] | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
cli: ${{ env.clojure-version }} | |
- name: "Install rlwrap" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: sudo apt-get -y install rlwrap | |
shell: bash | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash clojure-tests.sh | |
shell: bash | |
test-cpp: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
cpp/** | |
cpp-tests.sh | |
- name: "Install cmake" | |
uses: lukka/[email protected] | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
cmakeVersion: ${{ env.cmake-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash cpp-tests.sh | |
shell: bash | |
test-dart: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
dart/** | |
dart-tests.sh | |
- name: "Setup Dart" | |
uses: dart-lang/setup-dart@v1 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
sdk: ${{ env.dart-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash dart-tests.sh | |
shell: bash | |
test-elixir: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
elixir/** | |
elixir-tests.sh | |
- name: "Setup BEAM" | |
uses: erlef/setup-beam@v1 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
otp-version: ${{ env.erlang-version }} | |
elixir-version: ${{ env.elixir-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash elixir-tests.sh | |
shell: bash | |
test-gleam: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
gleam/** | |
gleam-tests.sh | |
- name: "Setup BEAM" | |
uses: erlef/setup-beam@v1 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
otp-version: ${{ env.erlang-version }} | |
rebar3-version: ${{ env.rebar3-version }} | |
- name: "Setup Glam" | |
uses: gleam-lang/[email protected] | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
gleam-version: ${{ env.gleam-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash gleam-tests.sh | |
shell: bash | |
test-haskell: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
haskell/** | |
haskell-tests.sh | |
- name: "Caching" | |
uses: actions/cache@v3 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
path: | | |
~/.stack | |
haskell/*/.stack-work | |
key: ${{ runner.os }}-${{ env.ghc-version }}-${{ env.stack-version }}-stack | |
- name: "Setup GHC" | |
uses: haskell-actions/setup@v2 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
ghc-version: ${{ env.ghc-version }} | |
enable-stack: true | |
stack-version: ${{ env.stack-version }} | |
- name: "Install hlint" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: stack install hlint | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash haskell-tests.sh | |
shell: bash | |
test-javascript: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
javascript/** | |
javascript-tests.sh | |
- name: "Setup Node" | |
uses: actions/setup-node@v3 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
node-version: ${{ env.node-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash javascript-tests.sh | |
shell: bash | |
test-jq: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
jq/** | |
jq-tests.sh | |
- name: "Setup jq" | |
uses: dcarbone/[email protected] | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
version: '${{ env.jq-version }}' | |
force: true | |
- name: "Setup bats" | |
uses: mig4/setup-bats@v1 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
bats-version: '${{ env.bats-version }}' | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash jq-tests.sh | |
shell: bash | |
test-lua: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
lua/** | |
lua-tests.sh | |
- name: "Setup Lua" | |
uses: leafo/[email protected] | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
luaVersion: ${{ env.lua-version }} | |
- name: "Setup LuaRocks" | |
uses: leafo/gh-actions-luarocks@v4 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
luarocksVersion: ${{ env.lua-rocks-version }} | |
- name: "Install busted and build" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: | | |
luarocks install busted | |
luarocks install luacheck | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash lua-tests.sh | |
shell: bash | |
test-python: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
python/** | |
python-tests.sh | |
- name: "Setup Python" | |
uses: actions/setup-python@v4 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
python-version: ${{ env.python-version }} | |
- name: "Install pylint and pytest" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: pip install pylint pytest | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash python-tests.sh | |
shell: bash | |
test-ruby: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
ruby/** | |
ruby-tests.sh | |
- name: "Setup ruby" | |
uses: ruby/setup-ruby@v1 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
ruby-version: ${{ env.ruby-version }} | |
- name: "Install ruby gem" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: gem install minitest | |
shell: bash | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash ruby-tests.sh | |
shell: bash | |
test-rust: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
rust/** | |
rust-tests.sh | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash rust-tests.sh | |
shell: bash | |
test-zig: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get specific changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: | | |
zig/** | |
zig-tests.sh | |
- name: "Setup zig" | |
uses: goto-bus-stop/setup-zig@v2 | |
if: steps.changed-files.outputs.any_changed == 'true' | |
with: | |
version: ${{ env.zig-version }} | |
- name: "Run tests" | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: bash zig-tests.sh | |
shell: bash |