Skip to content

Commit a38ea0e

Browse files
Test linux arm support
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent 494209d commit a38ea0e

File tree

9 files changed

+100
-3
lines changed

9 files changed

+100
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test CI Linux ARM
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
os: [ubuntu-22.04-arm, ubuntu-24.04-arm]
13+
python-version: ["3.10", "3.14"]
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install system dependencies
25+
run: |
26+
sudo apt update
27+
sudo apt install libarchive-tools libarchive-dev libmagic1 libmagic-dev
28+
29+
- name: Set up venv
30+
run: ./configure --dev-system-provided
31+
32+
- name: Run tests
33+
run: venv/bin/pytest -n 3 -vvs .

.github/workflows/test-ci-mac.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test CI Mac
1+
name: Test CI Macos ARM
22

33
on: [push, pull_request]
44

@@ -24,7 +24,7 @@ jobs:
2424
- name: Install system dependencies
2525
run: |
2626
brew update
27-
brew install p7zip libarchive libmagic
27+
brew install libarchive libmagic
2828
2929
- name: Set up venv
3030
run: ./configure --dev-system-provided
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
filetype_file: PE32+ executable (DLL) x86-64, for MS Windows
2+
mimetype_file: application/x-dosexec
3+
mimetype_python: application/x-msdownload
4+
is_file: yes
5+
is_regular: yes
6+
size: 3394
7+
is_binary: yes
8+
contains_text: yes
9+
is_winexe: yes
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
filetype_file: data
2+
mimetype_file: application/octet-stream
3+
is_file: yes
4+
is_regular: yes
5+
size: 3487
6+
is_binary: yes
7+
is_data: yes
8+
contains_text: yes
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
filetype_file: data
2+
mimetype_file: application/octet-stream
3+
mimetype_python: text/x-java-source
4+
filetype_pygment: Java
5+
programming_language: Java
6+
is_file: yes
7+
is_regular: yes
8+
size: 4116
9+
is_text: yes
10+
is_data: yes
11+
contains_text: yes
12+
is_java_source: yes
13+
is_source: yes
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
filetype_file: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
2+
mimetype_file: application/x-dosexec
3+
mimetype_python: application/x-msdownload
4+
is_file: yes
5+
is_regular: yes
6+
size: 45056
7+
is_binary: yes
8+
contains_text: yes
9+
is_winexe: yes
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
filetype_file: PE32 executable (DLL) (console) Intel 80386 (stripped to external PDB), for MS Windows
2+
mimetype_file: application/x-dosexec
3+
mimetype_python: application/x-msdownload
4+
is_file: yes
5+
is_regular: yes
6+
size: 72192
7+
is_binary: yes
8+
contains_text: yes
9+
is_winexe: yes
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
filetype_file: PCX ver. 3.0 image data bounding box [0, 0] - [0, 0], 1-bit colour, 72 x 72 dpi, RLE compressed
2+
mimetype_file: application/octet-stream
3+
mimetype_python: image/x-pcx
4+
is_file: yes
5+
is_regular: yes
6+
size: 130
7+
is_binary: yes
8+
is_data: yes
9+
is_archive: yes
10+
is_compressed: yes
11+
is_media: yes
12+
is_media_with_meta: yes

tests/filetype_test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import pytest
1717
import saneyaml
1818

19+
from commoncode.system import on_linux
1920
from commoncode.system import on_mac
2021
from commoncode.system import on_windows
2122
from commoncode.testcase import FileDrivenTesting
@@ -115,7 +116,10 @@ class FileTypeTest(object):
115116
def __attrs_post_init__(self, *args, **kwargs):
116117
if self.data_file:
117118
if is_arm_architecture():
118-
other_file = self.data_file.replace(".yml", ".yml-mac-system-provided~")
119+
if on_mac:
120+
other_file = self.data_file.replace(".yml", ".yml-mac-system-provided~")
121+
elif on_linux:
122+
other_file = self.data_file.replace(".yml", ".yml-linux-system-provided~")
119123
if path.exists(other_file):
120124
self.data_file = other_file
121125

0 commit comments

Comments
 (0)