Compare commits

...

15 commits

Author SHA1 Message Date
Egor Tensin
6e80af98bd README: update 2023-02-17 14:42:49 +01:00
Egor Tensin
ef434b41eb remove hack 2023-01-02 05:08:55 +01:00
Egor Tensin
7eeaf563e4 workflows/test: add Jammy, versions 14-15 2023-01-02 05:05:53 +01:00
Egor Tensin
5cc3e08645 simplify and future-proof adding apt repositories 2023-01-02 05:00:46 +01:00
Egor Tensin
43ade2b388 workflows/test: upgrade actions 2023-01-02 04:44:10 +01:00
Egor Tensin
93f89834ca set-output is deprecated 2023-01-02 04:42:57 +01:00
Egor Tensin
4535330f96 workflows/test: ignore Cygwin jobs for now 2023-01-02 04:37:24 +01:00
Egor Tensin
74a1183273 workflows/test: disable x86 Cygwin 2023-01-02 03:35:12 +01:00
Egor Tensin
190f39dc69 workflows/test: actualize runner OSes 2023-01-02 03:35:12 +01:00
Egor Tensin
4b8d6e7c31 workflows/test: test on windows-2022 2021-12-15 18:48:50 +03:00
Egor Tensin
71d1a06d04 add couple of comments 2021-10-15 14:31:18 +03:00
Egor Tensin
95dbaa7ec8 add Ubuntu 21.10 2021-10-15 14:27:57 +03:00
Egor Tensin
01d437c061 set up clang/clang++ symlinks 2021-09-05 21:52:59 +03:00
Egor Tensin
bbe81e2da0 version 13 has been released 2021-08-21 19:11:01 +03:00
Egor Tensin
ce67c296ea README: update 2021-07-08 12:17:05 +03:00
6 changed files with 79 additions and 82 deletions

View file

@ -1,9 +1,5 @@
name: Build foo.exe
description: Build foo.exe (on Cygwin)
inputs:
platform:
description: Target platform
required: true
runs:
using: composite
steps:
@ -14,7 +10,6 @@ runs:
echo "$src_dir"
src_dir="$( cygpath -ua "$src_dir" )"
cd -- "$src_dir"
arch=
[ '${{ matrix.platform }}' == 'x86' ] && arch=-m32
clang++ $arch -std=c++14 -o foo.exe foo.cpp
clang++ --version
clang++ -std=c++14 -o foo.exe foo.cpp
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'

View file

@ -1,5 +1,5 @@
name: Check cc/c++
description: Check cc/c++ (on Cygwin)
name: Check symlinks
description: Check symlinks (on Cygwin)
runs:
using: composite
steps:

View file

@ -1,5 +1,5 @@
name: Check cc/c++
description: Check cc/c++
name: Check symlinks
description: Check symlinks
inputs:
version:
description: Specific version to check
@ -28,5 +28,7 @@ runs:
}
Check-Exe cc
Check-Exe clang
Check-Exe c++
Check-Exe clang++
shell: pwsh

View file

@ -13,14 +13,14 @@ jobs:
strategy:
matrix:
platform: [x86, x64]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest, windows-2016, windows-2019, windows-latest]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
runs-on: '${{ matrix.os }}'
name: 'Test: ${{ matrix.os }} / ${{ matrix.platform }}'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v3
if: runner.os == 'Windows'
- name: Set up Clang
uses: ./
@ -31,25 +31,36 @@ jobs:
uses: ./.github/actions/build-foo
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
versions:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
version: ['3.9', '4.0', 4, '5.0', 5, '6.0', 6, 7, 8, 9, 10, 11, 12]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
version: ['3.9', '4.0', 4, '5.0', 5, '6.0', 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
exclude:
- {os: ubuntu-20.04, version: '3.9'}
- {os: ubuntu-20.04, version: '4.0'}
- {os: ubuntu-20.04, version: 4}
- {os: ubuntu-20.04, version: '5.0'}
- {os: ubuntu-20.04, version: 5}
- {os: ubuntu-22.04, version: '3.9'}
- {os: ubuntu-22.04, version: '4.0'}
- {os: ubuntu-22.04, version: 4}
- {os: ubuntu-22.04, version: '5.0'}
- {os: ubuntu-22.04, version: 5}
- {os: ubuntu-22.04, version: '6.0'}
- {os: ubuntu-22.04, version: 6}
- {os: ubuntu-22.04, version: 7}
- {os: ubuntu-22.04, version: 8}
- {os: ubuntu-22.04, version: 9}
- {os: ubuntu-22.04, version: 10}
runs-on: '${{ matrix.os }}'
name: 'Version: ${{ matrix.os }} / ${{ matrix.version }}'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: setup
name: Set up Clang
uses: ./
@ -63,7 +74,7 @@ jobs:
binary: '${{ steps.setup.outputs.clangxx }}'
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
with:
version: '${{ matrix.version }}'
@ -71,23 +82,22 @@ jobs:
cygwin:
strategy:
matrix:
platform: [x86, x64]
hardlinks: [0, 1]
runs-on: windows-latest
name: 'Cygwin: ${{ matrix.platform }} / hardlinks${{ matrix.hardlinks }}'
name: 'Cygwin: hardlinks${{ matrix.hardlinks }}'
# As of January 2023, clang simply doesn't work on Cygwin.
# It's also marked "Unmaintained" in the installer.
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Clean up PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v3
- name: Install Cygwin
uses: egor-tensin/setup-cygwin@v3
with:
platform: '${{ matrix.platform }}'
uses: egor-tensin/setup-cygwin@v4
- name: Set up Clang
uses: ./
with:
platform: '${{ matrix.platform }}'
cygwin: 1
cc: 1
hardlinks: '${{ matrix.hardlinks }}'
@ -99,9 +109,9 @@ jobs:
if: '!matrix.hardlinks'
- name: Run foo.exe
uses: ./.github/actions/run-foo
- name: Check cc/c++
- name: Check symlinks
uses: ./.github/actions/check-cc
if: matrix.hardlinks
- name: Check cc/c++ on Cygwin
- name: Check symlinks
uses: ./.github/actions/check-cc-cygwin
if: '!matrix.hardlinks'

View file

@ -39,15 +39,15 @@ API
| | *any* | | Install the i686 toolchain.
| cygwin | *any* | ✓ | Install native binaries.
| | 1 | | Install Cygwin packages.
| cc | 1 | ✓ | Set up `cc`/`c++` executables.
| | *any* | | Don't set up `cc`/`c++`.
| cc | 1 | ✓ | Set up `cc`/`clang`/`c++`/`clang++` executables.
| | *any* | | Don't set up the executables.
| hardlinks | *any* | ✓ | Cygwin: don't convert any symlinks.
| | 1 | | Cygwin: convert symlinks in /usr/bin to hardlinks.
| Output | Example | Description
| ------- | --------- | -----------
| clang | clang-4.0 | clang compiler binary file name
| clangxx | clang++-7 | clang++ compiler binary file name
| clang | clang-4.0 | `clang` binary name
| clangxx | clang++-7 | `clang++` binary name
Supported versions
------------------
@ -61,24 +61,26 @@ The `version` parameter value is not checked for being an available version for
the current distribution.
The supported versions for a particular distribution are those found in that
distro's repositories & those in the LLVM repository.
For example, the supported versions for Bionic & Focal as of July 2021 are
listed below.
For example, you can find the list of available versions as of January 2023
below.
| `version` | Bionic | Focal
| --------- | ------ | -----
| 3.9 | ✓ |
| 4.0 | ✓ |
| 5.0 | ✓ |
| 6.0 | ✓ | ✓
| 7 | ✓ | ✓
| 8 | ✓ | ✓
| 9 | ✓ | ✓
| 10 | ✓ | ✓
| 11 | ✓ | ✓
| 12 | ✓ | ✓
| `version` | Bionic | Focal | Jammy
| --------- | ------ | ----- | -----
| 3.9 | ✓ | |
| 4.0 | ✓ | |
| 5.0 | ✓ | |
| 6.0 | ✓ | ✓ |
| 7 | ✓ | ✓ |
| 8 | ✓ | ✓ |
| 9 | ✓ | ✓ |
| 10 | ✓ | ✓ |
| 11 | ✓ | ✓ | ✓
| 12 | ✓ | ✓ | ✓
| 13 | ✓ | ✓ | ✓
| 14 | ✓ | ✓ | ✓
| 15 | ✓ | ✓ | ✓
This table is not definitive; I expect more future versions to be made
available, especially for Focal.
This table should be updated periodically; it's a work-in-progress.
On Windows and Cygwin, the `version` parameter is ignored.

View file

@ -15,7 +15,7 @@ inputs:
required: false
default: 0
cc:
description: Set up cc/c++ executables
description: Set up cc/clang/c++/clang++ executables
required: false
default: 1
hardlinks:
@ -75,15 +75,6 @@ runs:
}
}
function Get-DistroVersion {
if (!(Get-Command lsb_release -ErrorAction SilentlyContinue)) {
throw "Couldn't find lsb_release; LLVM only provides repositories for Debian/Ubuntu"
}
$distro = lsb_release -is
$version = lsb_release -sr
"$distro-$version"
}
function Format-UpstreamVersion {
param(
[Parameter(Mandatory=$true)]
@ -107,25 +98,12 @@ runs:
[string] $Version
)
$distro = Get-DistroVersion
switch -Wildcard -CaseSensitive ($distro) {
'Debian-9*' { "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-$Version main" }
'Debian-10*' { "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-$Version main" }
'Debian-11*' { "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-$Version main" }
'Debian-unstable' { "deb http://apt.llvm.org/unstable/ llvm-toolchain-$Version main" }
'Debian-testing' { "deb http://apt.llvm.org/unstable/ llvm-toolchain-$Version main" }
'Ubuntu-16.04' { "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-$Version main" }
'Ubuntu-18.04' { "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$Version main" }
'Ubuntu-18.10' { "deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic-$Version main" }
'Ubuntu-19.04' { "deb http://apt.llvm.org/disco/ llvm-toolchain-disco-$Version main" }
'Ubuntu-19.10' { "deb http://apt.llvm.org/eoan/ llvm-toolchain-eoan-$Version main" }
'Ubuntu-20.04' { "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$Version main" }
'Ubuntu-20.10' { "deb http://apt.llvm.org/groovy/ llvm-toolchain-groovy-$Version main" }
'Ubuntu-21.04' { "deb http://apt.llvm.org/hirsute/ llvm-toolchain-hirsute-$Version main" }
default { throw "Unsupported distribution: $distro" }
if (!(Get-Command lsb_release -ErrorAction SilentlyContinue)) {
throw "Couldn't find lsb_release; LLVM only provides repositories for Debian/Ubuntu"
}
$codename = lsb_release -sc
"deb http://apt.llvm.org/$codename/ llvm-toolchain-$codename-$Version main"
}
function Add-UpstreamRepo {
@ -160,8 +138,9 @@ runs:
if (!$x64) {
$pkg_gxx = 'g++-multilib'
}
$packages = $pkg_clang,$pkg_llvm,$pkg_gxx
Install-Package $pkg_clang $pkg_llvm $pkg_gxx
Install-Package $packages
} elseif ($cygwin_host) {
if (!$x64) {
echo @'
@ -186,8 +165,8 @@ runs:
throw "Sorry, installing Clang is unsupported on $os"
}
echo "::set-output name=clang::$clang"
echo "::set-output name=clangxx::$clangxx"
echo "clang=$clang" >> $env:GITHUB_OUTPUT
echo "clangxx=$clangxx" >> $env:GITHUB_OUTPUT
shell: pwsh
- run: |
@ -199,6 +178,9 @@ runs:
New-Variable cc -Value ('${{ inputs.cc }}' -eq '1') -Option Constant
New-Variable clang -Value '${{ steps.install.outputs.clang }}' -Option Constant
New-Variable clangxx -Value '${{ steps.install.outputs.clangxx }}' -Option Constant
function Link-Exe {
param(
[Parameter(Mandatory=$true)]
@ -222,8 +204,14 @@ runs:
}
if ($cc) {
Link-Exe '${{ steps.install.outputs.clang }}' cc
Link-Exe '${{ steps.install.outputs.clangxx }}' c++
Link-Exe $clang cc
if ($clang -ne 'clang') {
Link-Exe $clang 'clang'
}
Link-Exe $clangxx c++
if ($clangxx -ne 'clang++') {
Link-Exe $clangxx 'clang++'
}
}
shell: pwsh