Skip to content

Commit

Permalink
Merge pull request #92 from VisorFolks/test_actions
Browse files Browse the repository at this point in the history
Test actions
  • Loading branch information
akashkollipara authored Jan 13, 2022
2 parents aa51758 + 12c1ab4 commit e66cb23
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 11 deletions.
46 changes: 41 additions & 5 deletions .github/workflows/github_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ jobs:
build:

runs-on: ubuntu-latest

env:
SONAR_SCANNER_VERSION: 4.4.0.2170
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: bw-output # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install Dependencies
run: sudo apt install cppcheck -y
Expand All @@ -30,9 +35,40 @@ jobs:
run: |
make get_avr_tc AVR_TC_REPO=https://github.com/VisorFolks/avr-toolchain.git
make get_riscv_tc RISC_V_TC_REPO=https://github.com/VisorFolks/risc-v-toolchain.git
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Build AVR
- name: Download and set up build-wrapper
env:
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
run: |
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all_projects
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
make demo_avr
make demo_avr_cpp
make demo_riscv
sonar-scanner \
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
--define sonar.organization=cyancore \
--define sonar.projectKey=VisorFolks_cyancore \
--define sonar.sources=src \
--define sonar.verbose=true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.scannerwork
sonar-cfamily-reproducer.zip
temp
out/
toolchain/
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

> **Version (arch:2 | major:4 | minor:2): 0.1.0**
[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-white.svg)](https://sonarcloud.io/summary/new_code?id=VisorFolks_cyancore)

![GitHub branch checks state](https://img.shields.io/github/checks-status/VisorFolks/cyancore/stable?label=Build%20Status)
![Lines of code](https://img.shields.io/tokei/lines/github/visorfolks/cyancore?label=Lines%20of%20code)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=VisorFolks_cyancore&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=VisorFolks_cyancore)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=VisorFolks_cyancore&metric=bugs)](https://sonarcloud.io/summary/new_code?id=VisorFolks_cyancore)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=VisorFolks_cyancore&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=VisorFolks_cyancore)

```
arch : 0x00
major : 0x0001
Expand All @@ -26,7 +32,7 @@ Click the above icon to connect

### Projects
run
```
```sh
$ make list
```

Expand All @@ -38,7 +44,7 @@ $ make list

### Help
run
```
```sh
$ make help
```

Expand All @@ -48,7 +54,10 @@ For details about the framework, follow the README.md in each folder.

Host system requirements:
* Linux Machine (WSL/Dedicated machine)
* make utility and cppcheck installed; run `$ sudo apt install build-essential cppcheck -y`
* make utility and cppcheck installed; run
```sh
$ sudo apt install build-essential cppcheck -y
```


Toolchain Requirements:
Expand Down
12 changes: 10 additions & 2 deletions mk/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ include mk/path.mk
include mk/mk_helper.mk

P_TARGETS += default cyancore check version copy_to_remote clean_remote
T_ALLOWLIST += help list clean
T_ALLOWLIST += help list clean all_projects
PROJECT_LIST := $(shell ls $(SRC)/projects/ -I *.template)

.PHONY: aux_target

default: aux_target
make $(PROJECT) cyancore -j$(N_JOBS)

all_projects:
for project in $(PROJECT_LIST); \
do \
make $$project check; \
make $$project; \
done

cyancore: version elf
$(info < / > Done !)

Expand All @@ -33,7 +41,7 @@ clean:

list:
$(info Available projects are :)
ls $(SRC)/projects/ -I *.template
echo $(PROJECT_LIST)

check: --lint

Expand Down
4 changes: 3 additions & 1 deletion mk/usage_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Usage : make <option> <command>
option : {list | get_all_tc | get_arm_tc | get_avr_tv |
get_riscv_tc | help} or <Project Name>
command : default (implicit) | clean | check | cyancore |
copy_to_remote clean_remote
copy_to_remote clean_remote | all_projects
----------------------------------------------------------
> Project Name:
* The project name is the name of directory under
Expand Down Expand Up @@ -32,4 +32,6 @@ command : default (implicit) | clean | check | cyancore |
machine.
> clean_remote:
* This command removes folders from remote machine.
> all_projects:
* This command build all the projects listed by make list
==========================================================

0 comments on commit e66cb23

Please sign in to comment.