:: commit bc19e13282e0b56d550cce0b0a6fc2756bfeaf85

Kamila Szewczyk <27734421+kspalaiologos@users.noreply.github.com> — 2022-05-14 14:12

parents: 8f671ebdeb

Github Actions for non-x86 architectures (#24)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e4539f2..bb92686 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -45,7 +45,7 @@ jobs:
     - name: Make
       run: make
     - name: Check
-      run: make check
+      run: make roundtrip
 
   build-bsd:
     name: Build on FreeBSD
@@ -63,6 +63,40 @@ jobs:
       with:
         usesh: true
         run: |
-          ./configure
-          make
-          make check
+          pkg install -y llvm gmake
+          MAKE=gmake ./configure
+          gmake
+          gmake roundtrip
+
+  build-archs:
+    name: Build Matrix for non-x86 architectures
+    needs: [ dist ]
+    strategy:
+      fail-fast: false
+      matrix:
+        compiler: [ clang, gcc ]
+        feature: [ with-pthread, without-pthread ]
+        arch: [ armv6, armv7, aarch64, s390x, ppc64le ]
+    runs-on: ubuntu-latest
+    steps:
+    - name: Download source package artifact
+      uses: actions/download-artifact@v3
+      with:
+        name: bzip3-${{ github.sha }}
+    - name: Extract source package
+      run: tar --strip-components=1 -xf bzip3-${{ github.sha}}.tar.gz
+    - uses: uraimo/run-on-arch-action@v2
+      name: Run in the container
+      with:
+        arch: ${{ matrix.arch }}
+        distro: stretch
+        shell: /bin/sh
+        dockerRunArgs: |
+          --volume "${PWD}:/bzip3"
+        install: |
+          apt update -q -y
+          apt install -q -y clang gcc make
+        run: |
+          cd /bzip3
+          ./configure CC=${{ matrix.compiler }} --${{ matrix.feature }} --disable-arch-native --disable-link-time-optimization
+          make && make roundtrip
diff --git a/.gitignore b/.gitignore
index 7f7da34..6e707ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ tags
 bzip3
 bzip3-*
 .version
+LICENSE2
 .version-prev
 
 # Autotools
diff --git a/Makefile.am b/Makefile.am
index 51b6be0..cfb531d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,7 +64,10 @@ format: $(bzip3_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
 cloc: $(bzip3_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
 	cloc $^
 
+CLEANFILES += LICENSE2
 .PHONY: roundtrip
-roundtrip: $(bin_PROGRAMS)
-	time ./$< -e -b 6 etc/shakespeare.txt
-	time ./$< -d etc/shakespeare.txt.bz3
+roundtrip: bzip3$(EXEEXT)
+	rm -f LICENSE2
+	./$< -e -b 6 LICENSE
+	./$< -d LICENSE.bz3 LICENSE2
+	cmp LICENSE LICENSE2
tab: 248 wrap: offon