Update README.md #50
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: Build-and-Test | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Set up JDK for Java compilation | ||
- name: Use Java 14 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '14' | ||
# Install Dart SDK | ||
- name: Setup Dart | ||
uses: actions/setup-dart@master | ||
# Compile Dart files | ||
- name: Test Dart | ||
run: flutter pub get && flutter test --coverage | ||
working-directory: path/to/your/dart/project | ||
## Compile C files using gcc | ||
- name: Build C | ||
env: | ||
GCC_EXTRA_ARGS: "-Wall -Werror" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Environment | ||
uses: actions/[email protected] | ||
args: | ||
install-sun-javasdk: true | ||
env: | ||
PATH: "${{ runner.tools.java.install_rpath }}:${{ runner.os.pathsep}}$(PATH)" | ||
- name: Build C | ||
working-directory: ${{ github.workspace }} | ||
continues-on-error: false | ||
shell: bash | ||
script: | | ||
set +e | ||
find . -type f \( -iname "main.c" \) -exec sh -c 'cd \$(dirname {}) && make clean && make' \; | ||
exit $? | ||
## Compile Assembly files using NASM | ||
- name: Build Assembly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Environment | ||
uses: actions/setup-nasm@v1 | ||
- name: Build Assembly | ||
working-directory: ${{ github.workspace }} | ||
continues-on-error: false | ||
shell: bash | ||
script: | | ||
find . -type s -name "*.asm" | while read src; do | ||
cd "$(dirname $src)" | ||
nasm -f elf64 "$basename $src" -o "${basename $src%.asm}.o" | ||
ld -m elf_x86_64 -T link.ld "${basename $src%.asm}.o" -o "${basename $src%.*}" | ||
done | ||
## Run tests for Java files | ||
- name: Test Java | ||
if: file('**.java') > 0 || file('**/.gradle') != '' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Test | ||
uses: actions/test/junit@v1 | ||
args: | ||
jdk: 'oraclejdk-14' | ||
tests: **/*Test.java | ||
working-directory: path/to/your/java/project |