mirror of
				https://github.com/speed47/spectre-meltdown-checker.git
				synced 2025-10-31 20:50:55 +01:00 
			
		
		
		
	chore: add github check workflow
This commit is contained in:
		
							
								
								
									
										56
									
								
								.github/workflows/check.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								.github/workflows/check.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,56 @@ | |||||||
|  | name: CI | ||||||
|  |  | ||||||
|  | on: [push] | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build: | ||||||
|  |  | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |  | ||||||
|  |     steps: | ||||||
|  |     - uses: actions/checkout@v1 | ||||||
|  |     - name: install prerequisites | ||||||
|  |       run: sudo apt-get install -y shellcheck jq | ||||||
|  |     - name: shellcheck | ||||||
|  |       run: shellcheck -s sh spectre-meltdown-checker.sh | ||||||
|  |     - name: check indentation | ||||||
|  |       run: | | ||||||
|  |         if [ $(grep -cPv "^\t*\S|^$" spectre-meltdown-checker.sh) != 0 ]; then | ||||||
|  |           echo "Badly indented lines found:" | ||||||
|  |           grep -nPv "^\t*\S|^$" spectre-meltdown-checker.sh | ||||||
|  |           exit 1 | ||||||
|  |         else | ||||||
|  |           echo "Indentation seems correct." | ||||||
|  |         fi | ||||||
|  |     - name: check direct execution | ||||||
|  |       run: | | ||||||
|  |         expected=13 | ||||||
|  |         nb=$(sudo ./spectre-meltdown-checker.sh --batch json | jq '.[]|.CVE' | wc -l) | ||||||
|  |         if [ "$nb" -ne "$expected" ]; then | ||||||
|  |           echo "Invalid number of CVEs reported: $nb instead of $expected" | ||||||
|  |           exit 1 | ||||||
|  |         else | ||||||
|  |           echo "OK $nb CVEs reported" | ||||||
|  |         fi | ||||||
|  |     - name: check docker-compose run execution | ||||||
|  |       run: | | ||||||
|  |         expected=13 | ||||||
|  |         docker-compose build | ||||||
|  |         nb=$(docker-compose run --rm spectre-meltdown-checker --batch json | jq '.[]|.CVE' | wc -l) | ||||||
|  |         if [ "$nb" -ne "$expected" ]; then | ||||||
|  |           echo "Invalid number of CVEs reported: $nb instead of $expected" | ||||||
|  |           exit 1 | ||||||
|  |         else | ||||||
|  |           echo "OK $nb CVEs reported" | ||||||
|  |         fi | ||||||
|  |     - name: check docker run execution | ||||||
|  |       run: | | ||||||
|  |         expected=13 | ||||||
|  |         docker build -t spectre-meltdown-checker . | ||||||
|  |         nb=$(docker run --rm --privileged -v /boot:/boot:ro -v /dev/cpu:/dev/cpu:ro -v /lib/modules:/lib/modules:ro spectre-meltdown-checker --batch json | jq '.[]|.CVE' | wc -l) | ||||||
|  |         if [ "$nb" -ne "$expected" ]; then | ||||||
|  |           echo "Invalid number of CVEs reported: $nb instead of $expected" | ||||||
|  |           exit 1 | ||||||
|  |         else | ||||||
|  |           echo "OK $nb CVEs reported" | ||||||
|  |         fi | ||||||
| @@ -2446,7 +2446,7 @@ check_cpu() | |||||||
| 		_info_nol "    * CPU indicates SSBD capability: " | 		_info_nol "    * CPU indicates SSBD capability: " | ||||||
| 		read_cpuid 0x80000008 $EBX 24 1 1; ret24=$? | 		read_cpuid 0x80000008 $EBX 24 1 1; ret24=$? | ||||||
| 		read_cpuid 0x80000008 $EBX 25 1 1; ret25=$? | 		read_cpuid 0x80000008 $EBX 25 1 1; ret25=$? | ||||||
| 		 |  | ||||||
| 		if [ $ret24 -eq 0 ]; then | 		if [ $ret24 -eq 0 ]; then | ||||||
| 			cpuid_ssbd='HYGON SSBD in SPEC_CTRL' | 			cpuid_ssbd='HYGON SSBD in SPEC_CTRL' | ||||||
| 			#hygon cpuid_ssbd_spec_ctrl=1 | 			#hygon cpuid_ssbd_spec_ctrl=1 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user