From e88dfacd5390d6506b814121a0d12a1833ca6204 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Mon, 31 Jan 2022 14:20:15 +0500 Subject: [PATCH] Split GitHub Actions into separate workflows --- .github/workflows/main.yml | 52 ++++++++++++++ .github/workflows/mruby.yml | 31 +++++++++ .github/workflows/ruby.yml | 38 +++++++++++ .github/workflows/rust.yml | 34 ++++++++++ .github/workflows/test.yml | 131 ------------------------------------ 5 files changed, 155 insertions(+), 131 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/mruby.yml create mode 100644 .github/workflows/ruby.yml create mode 100644 .github/workflows/rust.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a24526b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: Main + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + # TODO: something is wrong with TCC, Multiboot 2 info tag struct size + #cc: ['gcc', 'clang', 'tcc'] + cc: ['gcc', 'clang'] + opt: ['', '-O0', '-O3'] + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: dependencies + run: sudo apt-get --yes install clang tcc + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure --enable-tests CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} -fPIC' + - name: make + run: make + - name: check + run: make check || (cat test-suite.log && false) + - name: install + run: sudo make install + + cppcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: dependencies + run: sudo apt-get --yes install cppcheck + - name: cppcheck source code + # TODO: don't suppress "src/printf.c" + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress='*:src/printf.c' include/ src/ + - name: cppcheck examples + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=duplicateExpression --suppress=staticStringCompare examples/ + - name: cppcheck tests + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=unusedStructMember tests/ diff --git a/.github/workflows/mruby.yml b/.github/workflows/mruby.yml new file mode 100644 index 0000000..d09e311 --- /dev/null +++ b/.github/workflows/mruby.yml @@ -0,0 +1,31 @@ +name: mruby + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: dependencies + run: sudo apt-get --yes install cppcheck rake + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure CFLAGS='-O3 -fPIC' + - name: make + run: make + - name: install + run: sudo make install + - working-directory: vendor/mruby + name: test + run: MRUBY_CONFIG=../../pkgs/mruby/build_config.rb rake test + - working-directory: pkgs/mruby + name: cppcheck + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability . diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..9d0af3c --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,38 @@ +name: Ruby + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0 + - name: dependencies + run: sudo apt-get --yes install cppcheck + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure CFLAGS='-O3 -fPIC' + - name: make + run: make + - name: install + run: sudo make install + - working-directory: pkgs/ruby + name: bundle + run: bundle install + - working-directory: pkgs/ruby + name: compile + run: rake compile + - working-directory: pkgs/ruby + name: test & lint + run: rake + - working-directory: pkgs/ruby + name: cppcheck + run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability . diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..909c1a4 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,34 @@ +name: Rust + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + - name: autogen + run: ./autogen.sh + - name: configure + run: ./configure CFLAGS='-O3 -fPIC' + - name: make + run: make + - name: install + run: sudo make install + - working-directory: pkgs/rust + name: test + run: cargo test + - working-directory: pkgs/rust + name: fmt + run: cargo fmt --check + - working-directory: pkgs/rust + name: clippy + run: cargo clippy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f5015f7..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Test - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - # TODO: something is wrong with TCC, Multiboot 2 info tag struct size - #cc: ['gcc', 'clang', 'tcc'] - cc: ['gcc', 'clang'] - opt: ['', '-O0', '-O3'] - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: dependencies - run: sudo apt-get --yes install clang tcc - - name: autogen - run: ./autogen.sh - - name: configure - run: ./configure --enable-tests CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} -fPIC' - - name: make - run: make - - name: check - run: make check || (cat test-suite.log && false) - - name: install - run: sudo make install - - cppcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: dependencies - run: sudo apt-get --yes install cppcheck - - name: cppcheck source code - # TODO: don't suppress "src/printf.c" - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress='*:src/printf.c' include/ src/ - - name: cppcheck examples - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=duplicateExpression --suppress=staticStringCompare examples/ - - name: cppcheck tests - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=unusedStructMember tests/ - - mruby: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: dependencies - run: sudo apt-get --yes install cppcheck rake - - name: autogen - run: ./autogen.sh - - name: configure - run: ./configure CFLAGS='-O3 -fPIC' - - name: make - run: make - - name: install - run: sudo make install - - working-directory: vendor/mruby - name: test - run: MRUBY_CONFIG=../../pkgs/mruby/build_config.rb rake test - - working-directory: pkgs/mruby - name: cppcheck - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability . - - ruby: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0 - - name: dependencies - run: sudo apt-get --yes install cppcheck - - name: autogen - run: ./autogen.sh - - name: configure - run: ./configure CFLAGS='-O3 -fPIC' - - name: make - run: make - - name: install - run: sudo make install - - working-directory: pkgs/ruby - name: bundle - run: bundle install - - working-directory: pkgs/ruby - name: compile - run: rake compile - - working-directory: pkgs/ruby - name: test & lint - run: rake - - working-directory: pkgs/ruby - name: cppcheck - run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability . - - rust: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: rustfmt, clippy - - name: autogen - run: ./autogen.sh - - name: configure - run: ./configure CFLAGS='-O3 -fPIC' - - name: make - run: make - - name: install - run: sudo make install - - working-directory: pkgs/rust - name: test - run: cargo test - - working-directory: pkgs/rust - name: fmt - run: cargo fmt --check - - working-directory: pkgs/rust - name: clippy - run: cargo clippy