Skip to contentSkip to conversation

ci: bump versions in GitHub Actions

PATCH In review Christian Göttsche 2 participants 6 messages Aug 8, 2022 – Aug 15, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ci: bump versions in GitHub Actions

* Move from deprecated actions/setup-ruby to ruby/setup-ruby.
* Bump python and ruby upper versions.
* Bump Reference Policy version
* Do not install recommend packages and output package resolution
* Bump to macOS 12

macOS 10 is deprecated since 5/31/22 [1]. VirtualBox and Vagrant seems to be supported [2][3].

[1]: https://github.com/actions/virtual-environments/issues/5583
[2]: https://github.com/actions/virtual-environments/pull/5594
[3]: https://github.com/actions/virtual-environments/pull/5854

---
 .github/workflows/run_tests.yml    | 62 +++++++++++++++++-------------
 .github/workflows/vm_testsuite.yml |  5 +--
 2 files changed, 38 insertions(+), 29 deletions(-)
.github/workflows/run_tests.yml +36 -26
index 8b7cb720..db0e1af5 100644
@@ -10,48 +10,51 @@ jobs:
       matrix:
         compiler: [gcc, clang]
         python-ruby-version:
-          - {python: 3.9, ruby: 2.7}
-          - {python: 3.9, ruby: 2.7, other: test-flags-override}
-          - {python: 3.9, ruby: 2.7, other: test-debug}
-          - {python: 3.9, ruby: 2.7, other: linker-bfd}
-          - {python: 3.9, ruby: 2.7, other: linker-gold}
+          - {python: '3.10', ruby: '3.1'}
+          - {python: '3.10', ruby: '3.1', other: test-flags-override}
+          - {python: '3.10', ruby: '3.1', other: test-debug}
+          - {python: '3.10', ruby: '3.1', other: linker-bfd}
+          - {python: '3.10', ruby: '3.1', other: linker-gold}
           # Test several Python versions with the latest Ruby version
-          - {python: 3.8, ruby: 2.7}
-          - {python: 3.7, ruby: 2.7}
-          - {python: 3.6, ruby: 2.7}
-          - {python: 3.5, ruby: 2.7}
-          - {python: pypy3, ruby: 2.7}
+          - {python: '3.9', ruby: '3.1'}
+          - {python: '3.8', ruby: '3.1'}
+          - {python: '3.7', ruby: '3.1'}
+          - {python: '3.6', ruby: '3.1'}
+          - {python: '3.5', ruby: '3.1'}
+          - {python: 'pypy3.7', ruby: '3.1'}
           # Test several Ruby versions with the latest Python version
-          - {python: 3.9, ruby: 2.6}
-          - {python: 3.9, ruby: 2.5}
+          - {python: '3.10', ruby: '3.0'}
+          - {python: '3.10', ruby: '2.7'}
+          - {python: '3.10', ruby: '2.6'}
+          - {python: '3.10', ruby: '2.5'}
         exclude:
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-bfd}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-bfd}
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-gold}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-gold}
         include:
           - compiler: gcc
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: sanitizers}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: sanitizers}
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Set up Python ${{ matrix.python-ruby-version.python }}
-      uses: actions/setup-python@v2
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-ruby-version.python }}
 
     - name: Set up Ruby ${{ matrix.python-ruby-version.ruby }}
-      uses: actions/setup-ruby@v1
+      uses: ruby/setup-ruby@v1
       with:
         ruby-version: ${{ matrix.python-ruby-version.ruby }}
+        bundler-cache: true
 
     - name: Install dependencies
       run: |
-        sudo apt-get update -qq
-        sudo apt-get install -qqy \
+        sudo apt-get update -q
+        sudo apt-get install -qy --no-install-recommends \
             bison \
-            clang \
             flex \
             gawk \
             gettext \
@@ -61,14 +64,16 @@ jobs:
             libcunit1-dev \
             libdbus-glib-1-dev \
             libpcre2-dev \
-            python3-dev \
-            python-dev \
             ruby-dev \
             swig \
             xmlto
 
         pip install flake8
 
+    - name: Install Clang
+      if: ${{ matrix.compiler == 'clang' }}
+      run: sudo apt-get install -qqy clang
+
     - name: Configure the environment
       run: |
         DESTDIR=/tmp/destdir
@@ -82,6 +87,11 @@ jobs:
         elif [ "${{ matrix.python-ruby-version.other }}" = "linker-gold" ] ; then
             CC="$CC -fuse-ld=gold"
         fi
+        # https://bugs.ruby-lang.org/issues/18616
+        # https://github.com/llvm/llvm-project/issues/49958
+        if [ "${{ matrix.compiler }}" = "clang" ] && [[ "${{ matrix.python-ruby-version.ruby }}" = 3* ]] ; then
+            CC="$CC -fdeclspec"
+        fi
         echo "CC=$CC" >> $GITHUB_ENV
 
         EXPLICIT_MAKE_VARS=
@@ -110,7 +120,7 @@ jobs:
         PYTHON_SYS_PREFIX="$(python -c 'import sys;print(sys.prefix)')"
         echo "PKG_CONFIG_PATH=${PYTHON_SYS_PREFIX}/lib/pkgconfig" >> $GITHUB_ENV
 
-        if [ "${{ matrix.python-ruby-version.python }}" = "pypy3" ] ; then
+        if [[ "${{ matrix.python-ruby-version.python }}" = pypy* ]] ; then
             # PyPy does not provide a config file for pkg-config
             # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and bin/libpypy3-c.so for PyPy3
             echo "PYINC=-I${PYTHON_SYS_PREFIX}/include" >> $GITHUB_ENV
@@ -122,10 +132,10 @@ jobs:
 
     - name: Download and install refpolicy headers for sepolgen tests
       run: |
-        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20180701/refpolicy-2.20180701.tar.bz2
+        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20220520/refpolicy-2.20220520.tar.bz2
         tar -xvjf refpolicy.tar.bz2
         sed -e "s,^PREFIX :=.*,PREFIX := $DESTDIR/usr," -i refpolicy/support/Makefile.devel
-        sudo make -C refpolicy install-headers clean
+        sudo make -C refpolicy install-headers bare
         sudo mkdir -p /etc/selinux
         echo 'SELINUXTYPE=refpolicy' | sudo tee /etc/selinux/config
         echo 'SELINUX_DEVEL_PATH = /usr/share/selinux/refpolicy' | sudo tee /etc/selinux/sepolgen.conf
.github/workflows/vm_testsuite.yml +2 -3
index 601276dd..92155da2 100644
@@ -6,11 +6,10 @@ jobs:
   vm_testsuite:
 
     # Use VirtualBox+vagrant on macOS, as described in https://github.com/actions/virtual-environments/issues/433
-    # Use an old version of macOS until https://github.com/actions/virtual-environments/pull/4010 is merged.
-    runs-on: macos-10.15
+    runs-on: macos-12
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Create Vagrant VM
       run: |
Signature · 1 line
2.36.1
#1 lore raw

PATCH 2/4 scripts/ci: use F36 image instead of F34

---
 scripts/ci/Vagrantfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/ci/Vagrantfile +1 -1
index 20c523a0..b6023367 100644
@@ -34,7 +34,7 @@ SCRIPT
 # backwards compatibility). Please don't change it unless you know what
 # you're doing.
 Vagrant.configure("2") do |config|
-  config.vm.box = "fedora/34-cloud-base"
+  config.vm.box = "fedora/36-cloud-base"
   config.vm.synced_folder "../..", "/root/selinux"
 
   config.vm.provider "virtualbox" do |v|
Signature · 1 line
2.36.1
#2 lore raw

PATCH 3/4 scripts: ignore Flake8 tag E275

In reply to Christian Göttsche

./gui/polgengui.py:484:18: E275 missing whitespace after keyword ./gui/polgengui.py:530:18: E275 missing whitespace after keyword ./python/sepolgen/src/sepolgen/policygen.py:327:19: E275 missing whitespace after keyword ./python/sepolgen/src/sepolgen/policygen.py:329:11: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/__init__.py:453:15: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/generate.py:1349:28: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/generate.py:1351:28: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/gui.py:638:24: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/gui.py:863:23: E275 missing whitespace after keyword ./python/sepolicy/build/lib/sepolicy/gui.py:2177:16: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/__init__.py:453:15: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/generate.py:1349:28: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/generate.py:1351:28: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/gui.py:638:24: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/gui.py:863:23: E275 missing whitespace after keyword ./python/sepolicy/sepolicy/gui.py:2177:16: E275 missing whitespace after keyword ./sandbox/sandbox:114:7: E275 missing whitespace after keyword ./sandbox/sandbox:134:11: E275 missing whitespace after keyword ./sandbox/sandbox:136:7: E275 missing whitespace after keyword

---
 scripts/run-flake8 | 1 +
 1 file changed, 1 insertion(+)
scripts/run-flake8 +1 -0
index 67cccfe9..ad15f3d4 100755
@@ -58,6 +58,7 @@ IGNORE_LIST="$IGNORE_LIST,E261" # at least two spaces before inline comment
 IGNORE_LIST="$IGNORE_LIST,E265" # block comment should start with '# '
 IGNORE_LIST="$IGNORE_LIST,E266" # too many leading '#' for block comment
 IGNORE_LIST="$IGNORE_LIST,E272" # multiple spaces before keyword
+IGNORE_LIST="$IGNORE_LIST,E275" # missing whitespace after keyword
 IGNORE_LIST="$IGNORE_LIST,E301" # expected 1 blank line, found 0
 IGNORE_LIST="$IGNORE_LIST,E302" # expected 2 blank lines, found 1
 IGNORE_LIST="$IGNORE_LIST,E303" # too many blank lines
Signature · 1 line
2.36.1
#3 lore raw

PATCH 4/4 Ignore egg-info directories and clean them

In reply to Christian Göttsche

Test .gitignore and make clean distclean
error: missing .gitignore entry for libselinux/src/selinux.egg-info/
error: missing .gitignore entry for python/sepolicy/sepolicy.egg-info/
Error: Process completed with exit code 1.

error: "make clean distclean" did not remove libselinux/src/selinux.egg-info/PKG-INFO
error: "make clean distclean" did not remove libselinux/src/selinux.egg-info/SOURCES.txt
error: "make clean distclean" did not remove libselinux/src/selinux.egg-info/dependency_links.txt
error: "make clean distclean" did not remove libselinux/src/selinux.egg-info/top_level.txt
error: "make clean distclean" did not remove python/sepolicy/sepolicy.egg-info/PKG-INFO
error: "make clean distclean" did not remove python/sepolicy/sepolicy.egg-info/SOURCES.txt
error: "make clean distclean" did not remove python/sepolicy/sepolicy.egg-info/dependency_links.txt
error: "make clean distclean" did not remove python/sepolicy/sepolicy.egg-info/top_level.txt
Error: Process completed with exit code 1.

---
 libselinux/src/.gitignore  | 1 +
 libselinux/src/Makefile    | 2 +-
 python/sepolicy/.gitignore | 1 +
 python/sepolicy/Makefile   | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)
libselinux/src/.gitignore +1 -0
index 001f20b0..94400e81 100644
@@ -1,3 +1,4 @@
 selinux.py
 selinuxswig_python_wrap.c
 selinuxswig_ruby_wrap.c
+selinux.egg-info/
libselinux/src/Makefile +1 -1
index 88aa32f8..49b7d60a 100644
@@ -201,7 +201,7 @@ relabel:
 clean-pywrap:
 	-rm -f $(SWIGLOBJ) $(SWIGSO) $(AUDIT2WHYLOBJ) $(AUDIT2WHYSO)
 	$(PYTHON) setup.py clean
-	-rm -rf build *~ \#* *pyc .#*
+	-rm -rf build *~ \#* *pyc .#* selinux.egg-info/
 
 clean-rubywrap:
 	-rm -f $(SWIGRUBYLOBJ) $(SWIGRUBYSO)
python/sepolicy/.gitignore +1 -0
index 3186c860..32fb47f9 100644
@@ -1,3 +1,4 @@
 build
 tmp
 *.bak
+sepolicy.egg-info/
python/sepolicy/Makefile +1 -1
index 3361be4e..d983e409 100644
@@ -18,7 +18,7 @@ python-build:
 
 clean:
 	$(PYTHON) setup.py clean
-	-rm -rf build *~ \#* *pyc .#*
+	-rm -rf build *~ \#* *pyc .#* sepolicy.egg-info/
 
 sepolgen:
 	ln -sf sepolicy sepolgen
Signature · 1 line
2.36.1
Acked-by on v1 1/4
#4 lore raw
In reply to Christian Göttsche
Quoted 7 lines · Christian Göttsche

* Move from deprecated actions/setup-ruby to ruby/setup-ruby.
* Bump python and ruby upper versions.
* Bump Reference Policy version
* Do not install recommend packages and output package resolution
* Bump to macOS 12

Quoted 8 lines

macOS 10 is deprecated since 5/31/22 [1]. VirtualBox and Vagrant seems to be supported [2][3].

[1]: https://github.com/actions/virtual-environments/issues/5583
[2]: https://github.com/actions/virtual-environments/pull/5594
[3]: https://github.com/actions/virtual-environments/pull/5854

For this series:

Quoted 156 lines
---
 .github/workflows/run_tests.yml    | 62 +++++++++++++++++-------------
 .github/workflows/vm_testsuite.yml |  5 +--
 2 files changed, 38 insertions(+), 29 deletions(-)
.github/workflows/run_tests.yml +36 -26
index 8b7cb720..db0e1af5 100644
@@ -10,48 +10,51 @@ jobs:
       matrix:
         compiler: [gcc, clang]
         python-ruby-version:
-          - {python: 3.9, ruby: 2.7}
-          - {python: 3.9, ruby: 2.7, other: test-flags-override}
-          - {python: 3.9, ruby: 2.7, other: test-debug}
-          - {python: 3.9, ruby: 2.7, other: linker-bfd}
-          - {python: 3.9, ruby: 2.7, other: linker-gold}
+          - {python: '3.10', ruby: '3.1'}
+          - {python: '3.10', ruby: '3.1', other: test-flags-override}
+          - {python: '3.10', ruby: '3.1', other: test-debug}
+          - {python: '3.10', ruby: '3.1', other: linker-bfd}
+          - {python: '3.10', ruby: '3.1', other: linker-gold}
           # Test several Python versions with the latest Ruby version
-          - {python: 3.8, ruby: 2.7}
-          - {python: 3.7, ruby: 2.7}
-          - {python: 3.6, ruby: 2.7}
-          - {python: 3.5, ruby: 2.7}
-          - {python: pypy3, ruby: 2.7}
+          - {python: '3.9', ruby: '3.1'}
+          - {python: '3.8', ruby: '3.1'}
+          - {python: '3.7', ruby: '3.1'}
+          - {python: '3.6', ruby: '3.1'}
+          - {python: '3.5', ruby: '3.1'}
+          - {python: 'pypy3.7', ruby: '3.1'}
           # Test several Ruby versions with the latest Python version
-          - {python: 3.9, ruby: 2.6}
-          - {python: 3.9, ruby: 2.5}
+          - {python: '3.10', ruby: '3.0'}
+          - {python: '3.10', ruby: '2.7'}
+          - {python: '3.10', ruby: '2.6'}
+          - {python: '3.10', ruby: '2.5'}
         exclude:
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-bfd}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-bfd}
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-gold}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-gold}
         include:
           - compiler: gcc
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: sanitizers}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: sanitizers}
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Set up Python ${{ matrix.python-ruby-version.python }}
-      uses: actions/setup-python@v2
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-ruby-version.python }}
 
     - name: Set up Ruby ${{ matrix.python-ruby-version.ruby }}
-      uses: actions/setup-ruby@v1
+      uses: ruby/setup-ruby@v1
       with:
         ruby-version: ${{ matrix.python-ruby-version.ruby }}
+        bundler-cache: true
 
     - name: Install dependencies
       run: |
-        sudo apt-get update -qq
-        sudo apt-get install -qqy \
+        sudo apt-get update -q
+        sudo apt-get install -qy --no-install-recommends \
             bison \
-            clang \
             flex \
             gawk \
             gettext \
@@ -61,14 +64,16 @@ jobs:
             libcunit1-dev \
             libdbus-glib-1-dev \
             libpcre2-dev \
-            python3-dev \
-            python-dev \
             ruby-dev \
             swig \
             xmlto
 
         pip install flake8
 
+    - name: Install Clang
+      if: ${{ matrix.compiler == 'clang' }}
+      run: sudo apt-get install -qqy clang
+
     - name: Configure the environment
       run: |
         DESTDIR=/tmp/destdir
@@ -82,6 +87,11 @@ jobs:
         elif [ "${{ matrix.python-ruby-version.other }}" = "linker-gold" ] ; then
             CC="$CC -fuse-ld=gold"
         fi
+        # https://bugs.ruby-lang.org/issues/18616
+        # https://github.com/llvm/llvm-project/issues/49958
+        if [ "${{ matrix.compiler }}" = "clang" ] && [[ "${{ matrix.python-ruby-version.ruby }}" = 3* ]] ; then
+            CC="$CC -fdeclspec"
+        fi
         echo "CC=$CC" >> $GITHUB_ENV
 
         EXPLICIT_MAKE_VARS=
@@ -110,7 +120,7 @@ jobs:
         PYTHON_SYS_PREFIX="$(python -c 'import sys;print(sys.prefix)')"
         echo "PKG_CONFIG_PATH=${PYTHON_SYS_PREFIX}/lib/pkgconfig" >> $GITHUB_ENV
 
-        if [ "${{ matrix.python-ruby-version.python }}" = "pypy3" ] ; then
+        if [[ "${{ matrix.python-ruby-version.python }}" = pypy* ]] ; then
             # PyPy does not provide a config file for pkg-config
             # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and bin/libpypy3-c.so for PyPy3
             echo "PYINC=-I${PYTHON_SYS_PREFIX}/include" >> $GITHUB_ENV
@@ -122,10 +132,10 @@ jobs:
 
     - name: Download and install refpolicy headers for sepolgen tests
       run: |
-        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20180701/refpolicy-2.20180701.tar.bz2
+        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20220520/refpolicy-2.20220520.tar.bz2
         tar -xvjf refpolicy.tar.bz2
         sed -e "s,^PREFIX :=.*,PREFIX := $DESTDIR/usr," -i refpolicy/support/Makefile.devel
-        sudo make -C refpolicy install-headers clean
+        sudo make -C refpolicy install-headers bare
         sudo mkdir -p /etc/selinux
         echo 'SELINUXTYPE=refpolicy' | sudo tee /etc/selinux/config
         echo 'SELINUX_DEVEL_PATH = /usr/share/selinux/refpolicy' | sudo tee /etc/selinux/sepolgen.conf
.github/workflows/vm_testsuite.yml +2 -4
index 601276dd..92155da2 100644
@@ -6,11 +6,10 @@ jobs:
   vm_testsuite:
 
     # Use VirtualBox+vagrant on macOS, as described in https://github.com/actions/virtual-environments/issues/433
-    # Use an old version of macOS until https://github.com/actions/virtual-environments/pull/4010 is merged.
-    runs-on: macos-10.15
+    runs-on: macos-12
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Create Vagrant VM
       run: |
--

2.36.1

#5 lore raw
Quoted 13 lines · James Carter
Quoted 10 lines · Christian Göttsche

* Move from deprecated actions/setup-ruby to ruby/setup-ruby.
* Bump python and ruby upper versions.
* Bump Reference Policy version
* Do not install recommend packages and output package resolution
* Bump to macOS 12

macOS 10 is deprecated since 5/31/22 [1]. VirtualBox and Vagrant seems to be supported [2][3].

Quoted 9 lines
Quoted 5 lines

[1]: https://github.com/actions/virtual-environments/issues/5583
[2]: https://github.com/actions/virtual-environments/pull/5594
[3]: https://github.com/actions/virtual-environments/pull/5854

For this series:

This series has been merged.
Thanks,
Jim

Quoted 156 lines
Quoted 156 lines
---
 .github/workflows/run_tests.yml    | 62 +++++++++++++++++-------------
 .github/workflows/vm_testsuite.yml |  5 +--
 2 files changed, 38 insertions(+), 29 deletions(-)
.github/workflows/run_tests.yml +36 -26
index 8b7cb720..db0e1af5 100644
@@ -10,48 +10,51 @@ jobs:
       matrix:
         compiler: [gcc, clang]
         python-ruby-version:
-          - {python: 3.9, ruby: 2.7}
-          - {python: 3.9, ruby: 2.7, other: test-flags-override}
-          - {python: 3.9, ruby: 2.7, other: test-debug}
-          - {python: 3.9, ruby: 2.7, other: linker-bfd}
-          - {python: 3.9, ruby: 2.7, other: linker-gold}
+          - {python: '3.10', ruby: '3.1'}
+          - {python: '3.10', ruby: '3.1', other: test-flags-override}
+          - {python: '3.10', ruby: '3.1', other: test-debug}
+          - {python: '3.10', ruby: '3.1', other: linker-bfd}
+          - {python: '3.10', ruby: '3.1', other: linker-gold}
           # Test several Python versions with the latest Ruby version
-          - {python: 3.8, ruby: 2.7}
-          - {python: 3.7, ruby: 2.7}
-          - {python: 3.6, ruby: 2.7}
-          - {python: 3.5, ruby: 2.7}
-          - {python: pypy3, ruby: 2.7}
+          - {python: '3.9', ruby: '3.1'}
+          - {python: '3.8', ruby: '3.1'}
+          - {python: '3.7', ruby: '3.1'}
+          - {python: '3.6', ruby: '3.1'}
+          - {python: '3.5', ruby: '3.1'}
+          - {python: 'pypy3.7', ruby: '3.1'}
           # Test several Ruby versions with the latest Python version
-          - {python: 3.9, ruby: 2.6}
-          - {python: 3.9, ruby: 2.5}
+          - {python: '3.10', ruby: '3.0'}
+          - {python: '3.10', ruby: '2.7'}
+          - {python: '3.10', ruby: '2.6'}
+          - {python: '3.10', ruby: '2.5'}
         exclude:
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-bfd}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-bfd}
           - compiler: clang
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: linker-gold}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: linker-gold}
         include:
           - compiler: gcc
-            python-ruby-version: {python: 3.9, ruby: 2.7, other: sanitizers}
+            python-ruby-version: {python: '3.10', ruby: '3.1', other: sanitizers}
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Set up Python ${{ matrix.python-ruby-version.python }}
-      uses: actions/setup-python@v2
+      uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-ruby-version.python }}
 
     - name: Set up Ruby ${{ matrix.python-ruby-version.ruby }}
-      uses: actions/setup-ruby@v1
+      uses: ruby/setup-ruby@v1
       with:
         ruby-version: ${{ matrix.python-ruby-version.ruby }}
+        bundler-cache: true
 
     - name: Install dependencies
       run: |
-        sudo apt-get update -qq
-        sudo apt-get install -qqy \
+        sudo apt-get update -q
+        sudo apt-get install -qy --no-install-recommends \
             bison \
-            clang \
             flex \
             gawk \
             gettext \
@@ -61,14 +64,16 @@ jobs:
             libcunit1-dev \
             libdbus-glib-1-dev \
             libpcre2-dev \
-            python3-dev \
-            python-dev \
             ruby-dev \
             swig \
             xmlto
 
         pip install flake8
 
+    - name: Install Clang
+      if: ${{ matrix.compiler == 'clang' }}
+      run: sudo apt-get install -qqy clang
+
     - name: Configure the environment
       run: |
         DESTDIR=/tmp/destdir
@@ -82,6 +87,11 @@ jobs:
         elif [ "${{ matrix.python-ruby-version.other }}" = "linker-gold" ] ; then
             CC="$CC -fuse-ld=gold"
         fi
+        # https://bugs.ruby-lang.org/issues/18616
+        # https://github.com/llvm/llvm-project/issues/49958
+        if [ "${{ matrix.compiler }}" = "clang" ] && [[ "${{ matrix.python-ruby-version.ruby }}" = 3* ]] ; then
+            CC="$CC -fdeclspec"
+        fi
         echo "CC=$CC" >> $GITHUB_ENV
 
         EXPLICIT_MAKE_VARS=
@@ -110,7 +120,7 @@ jobs:
         PYTHON_SYS_PREFIX="$(python -c 'import sys;print(sys.prefix)')"
         echo "PKG_CONFIG_PATH=${PYTHON_SYS_PREFIX}/lib/pkgconfig" >> $GITHUB_ENV
 
-        if [ "${{ matrix.python-ruby-version.python }}" = "pypy3" ] ; then
+        if [[ "${{ matrix.python-ruby-version.python }}" = pypy* ]] ; then
             # PyPy does not provide a config file for pkg-config
             # libpypy-c.so is provided in bin/libpypy-c.so for PyPy and bin/libpypy3-c.so for PyPy3
             echo "PYINC=-I${PYTHON_SYS_PREFIX}/include" >> $GITHUB_ENV
@@ -122,10 +132,10 @@ jobs:
 
     - name: Download and install refpolicy headers for sepolgen tests
       run: |
-        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20180701/refpolicy-2.20180701.tar.bz2
+        curl --location --retry 10 -o refpolicy.tar.bz2 https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_2_20220520/refpolicy-2.20220520.tar.bz2
         tar -xvjf refpolicy.tar.bz2
         sed -e "s,^PREFIX :=.*,PREFIX := $DESTDIR/usr," -i refpolicy/support/Makefile.devel
-        sudo make -C refpolicy install-headers clean
+        sudo make -C refpolicy install-headers bare
         sudo mkdir -p /etc/selinux
         echo 'SELINUXTYPE=refpolicy' | sudo tee /etc/selinux/config
         echo 'SELINUX_DEVEL_PATH = /usr/share/selinux/refpolicy' | sudo tee /etc/selinux/sepolgen.conf
.github/workflows/vm_testsuite.yml +2 -4
index 601276dd..92155da2 100644
@@ -6,11 +6,10 @@ jobs:
   vm_testsuite:
 
     # Use VirtualBox+vagrant on macOS, as described in https://github.com/actions/virtual-environments/issues/433
-    # Use an old version of macOS until https://github.com/actions/virtual-environments/pull/4010 is merged.
-    runs-on: macos-10.15
+    runs-on: macos-12
 
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
 
     - name: Create Vagrant VM
       run: |
--

2.36.1