Add testing to workflows
parent
70989b963c
commit
cc9f7708c9
@ -0,0 +1,40 @@
|
||||
name: Integration-Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'utils/**'
|
||||
- 'doc/**'
|
||||
- 'docker/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'utils/**'
|
||||
- 'doc/**'
|
||||
- 'docker/**'
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Run integration tests
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Ruby 2.x
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.x
|
||||
- name: Set up Rust nightly
|
||||
run: |
|
||||
rustup self update
|
||||
rustup toolchain install nightly --component rust-src llvm-tools-preview
|
||||
rustup default nightly
|
||||
cargo install cargo-xbuild cargo-binutils
|
||||
- name: Make all
|
||||
run: |
|
||||
ruby utils/test_integration_all.rb
|
@ -0,0 +1,40 @@
|
||||
name: Unit-Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'utils/**'
|
||||
- 'doc/**'
|
||||
- 'docker/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'utils/**'
|
||||
- 'doc/**'
|
||||
- 'docker/**'
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Run unit tests
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Ruby 2.x
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.x
|
||||
- name: Set up Rust nightly
|
||||
run: |
|
||||
rustup self update
|
||||
rustup toolchain install nightly --component rust-src llvm-tools-preview
|
||||
rustup default nightly
|
||||
cargo install cargo-xbuild cargo-binutils
|
||||
- name: Make all
|
||||
run: |
|
||||
ruby utils/test_unit_all.rb
|
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
# SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
||||
|
||||
require 'fileutils'
|
||||
require_relative 'helpers/tutorial_folders.rb'
|
||||
|
||||
def run_tests
|
||||
Dir['tests/*.rs'].sort.each do |int_test|
|
||||
int_test = int_test.delete_prefix!('tests/').delete_suffix('.rs')
|
||||
exit(1) unless system("TEST=#{int_test} make test")
|
||||
end
|
||||
end
|
||||
|
||||
def test_integration_all
|
||||
crates = tutorial_folders(false, true)
|
||||
|
||||
crates.each do |x|
|
||||
tut = File.dirname(x)
|
||||
Dir.chdir(tut) do
|
||||
puts "\n\n" + tut.to_s + "\n\n"
|
||||
run_tests
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test_integration_all if $PROGRAM_NAME == __FILE__
|
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
# SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
#
|
||||
# Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
||||
|
||||
require 'fileutils'
|
||||
require_relative 'helpers/tutorial_folders.rb'
|
||||
|
||||
def test_unit_all
|
||||
crates = tutorial_folders(false, true)
|
||||
|
||||
crates.each do |x|
|
||||
x = File.dirname(x)
|
||||
Dir.chdir(x) do
|
||||
puts "\n\n" + x.to_s + "\n\n"
|
||||
exit(1) unless system('TEST=unit make test')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test_unit_all if $PROGRAM_NAME == __FILE__
|
Loading…
Reference in New Issue