Skip to content

Support 3.3.0

Support 3.3.0 #177

Workflow file for this run

name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on: pull_request
jobs:
cargo_test_workspace:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- run: cargo test --workspace
generate-version-matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.set-matrix.outputs.versions }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- name: make values
id: set-matrix
run: |
cat <<CODE | ruby >> $GITHUB_OUTPUT
require 'json'
versions = [
"3_1_0",
"3_2_0",
"3_3_0",
"master"
]
puts "versions=#{JSON.generate(versions)}"
CODE
cargo_test_minutus_all_versions:
name: cargo test minutus ${{ matrix.version }}
runs-on: ubuntu-latest
needs: generate-version-matrix
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.generate-version-matrix.outputs.versions) }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- run: cargo test -F mruby_${{ matrix.version }}
working-directory: minutus
cargo_test_minutus_test_all_versions:
name: cargo test minutus-test for ${{ matrix.version }}
runs-on: ubuntu-latest
needs: generate-version-matrix
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.generate-version-matrix.outputs.versions) }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- run: |
cp cargo_tomls/${{ matrix.version }}.toml Cargo.toml
cargo test
working-directory: minutus-test
generate-example-matrix:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.set-matrix.outputs.examples }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- name: make values
id: set-matrix
run: |
cat <<CODE | ruby >> $GITHUB_OUTPUT
require 'json'
puts "examples=#{JSON.generate(Dir.glob('examples/*'))}"
CODE
examples:
name: run specs on examples
runs-on: ubuntu-latest
needs: generate-example-matrix
strategy:
fail-fast: false
matrix:
example: ${{ fromJson(needs.generate-example-matrix.outputs.examples) }}
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- run: rake test
working-directory: ${{ matrix.example }}
minutus-mrbgem-template:
name: run spec on minutus-mrbgem-template
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
script:
- ./test.sh
- ./test_with_dependency.sh
steps:
- uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- run: cargo clean && ${{ matrix.script }}
working-directory: minutus-mrbgem-template
aggregated-ci:
runs-on: ubuntu-latest
needs:
[
cargo_test_minutus_all_versions,
cargo_test_minutus_test_all_versions,
cargo_test_workspace,
minutus-mrbgem-template,
examples,
]
if: always()
steps:
- name: All tests ok
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1