C++17 <filesystem> header (GCC 8+)

First time attempting to use Github Actions with my C++20 project.
Got it all working until it reached #include <filesystem> which is C++17 standard header.

GCC should support C++17 from version 8 but ubuntu-latest seems to use GNU 7.5.0 which was released in November 2019.
Is there a way to make it use newer version? Or do I need to wait for someone from Github to update it?

PS: Tried to link everything but it does allow me only 2 links so you must find it yourself.

According to the virtual environment documentation for ubuntu-latest (currently still at 18.04) it has a bunch of GCC versions installed:

  • GNU C++ 7.5.0, 8.4.0, 9.3.0, 10.1.0

If they follow the usual Ubuntu and Debian GCC packaging conventions you should be able to select the major version by suffixing gcc command with the version, e.g. run gcc-10 to select GCC 10.

Alternatively you can use jobs.<job_id>.container and use a container image that contains (or lets you install) whichever version you need.