Skip to content

CI

CI #390

Workflow file for this run

name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
defaults:
run:
shell: bash --noprofile --norc -CeEuxo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
secrets: inherit
test:
strategy:
fail-fast: false
matrix:
include:
# Test all non-deprecated images listed in https://github.com/actions/runner-images#available-images,
# and also msys64 & cygwin, which have different behavior than default https://github.com/taiki-e/install-action/pull/518#issuecomment-2160736760.
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
- os: windows-2019
- os: windows-2019
bash: msys64
- os: windows-2019
bash: cygwin
- os: windows-2022
- os: windows-2022
bash: msys64
- os: windows-2022
bash: cygwin
runs-on: ${{ matrix.os }}
steps:
- run: |
printf '%s\n' 'C:\msys64\mingw32\bin' >>"${GITHUB_PATH}"
printf '%s\n' 'C:\msys64\usr\bin' >>"${GITHUB_PATH}"
if: matrix.bash == 'msys64'
- run: |
choco install --no-progress --requirechecksums cygwin
printf '%s\n' 'C:\tools\cygwin\bin' >>"${GITHUB_PATH}"
printf '%s\n' 'C:\tools\cygwin\usr\bin' >>"${GITHUB_PATH}"
if: matrix.bash == 'cygwin'
# TODO: use the current branch instead of @main
- uses: taiki-e/checkout-action@main
- uses: taiki-e/install-action@shellcheck
- uses: taiki-e/install-action@shfmt
- run: git ls-files
- run: ./tools/tidy.sh
if: matrix.os != 'windows-2019'
# For comparison
actions-checkout:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: taiki-e/install-action@shellcheck
- uses: taiki-e/install-action@shfmt
- run: git ls-files
- run: ./tools/tidy.sh
test-container:
strategy:
fail-fast: false
matrix:
container:
- ubuntu:14.04 # glibc 2.19
- ubuntu:16.04 # glibc 2.23
- ubuntu:18.04 # glibc 2.27
- ubuntu:20.04 # glibc 2.31
- ubuntu:22.04 # glibc 2.35
- ubuntu:24.04 # glibc 2.39
- debian:9-slim # glibc 2.24
- debian:10-slim # glibc 2.28
- debian:11-slim # glibc 2.31
- debian:12-slim # glibc 2.36
- fedora:latest # glibc 2.39 (as of fedora 40)
- almalinux:8 # glibc 2.28
- almalinux:8-minimal # glibc 2.28
- almalinux:9 # glibc 2.34
- almalinux:9-minimal # glibc 2.34
- centos:6 # glibc 2.12
- centos:7 # glibc 2.17
- opensuse/leap:latest # glibc 2.38 (as of leap 15.6)
- opensuse/tumbleweed:latest # glibc 2.39 (as of 2024-07-19)
- archlinux:latest # glibc 2.39 (as of 2024-07-19)
- alpine:latest # musl 1.2.5 (as of alpine 3.20)
# TODO: opkg doesn't work since https://github.com/openwrt/openwrt/issues/16935#issuecomment-2472747379
# but apk is not installed in the 23.05/24.10 container: "apk: not found"
# - openwrt/rootfs:x86-64-openwrt-24.10 # musl 1.2.5
runs-on: ubuntu-latest
timeout-minutes: 60
container: ${{ matrix.container }}
steps:
- name: Install requirements (old debian)
run: |
# In Debian, the old repositories is removed from the main mirrors some time after EoL.
sed -i /etc/apt/sources.list -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d'
if: startsWith(matrix.container, 'debian:9')
- name: Install requirements (centos)
run: |
# In CentOS, the old repositories is removed from the main mirrors just after EoL.
# https://github.com/rust-lang/rust/pull/126352
sed -i /etc/yum.repos.d/*.repo -e 's!^mirrorlist!#mirrorlist!' \
-e 's!^#baseurl=http://mirror.centos.org/!baseurl=https://vault.centos.org/!'
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
if [[ "${{ matrix.container }}" == "centos:6" ]]; then
# CentOS 6's git (1.7.1) has no --local/--no-recurse-submodules.
# And even if we don't pass those flags, that version of git will not work
# anyway due to of "fatal: Couldn't find remote ref" error.
yum install -y openssh-clients perl perl-Error perl-TermReadKey rsync
rpm -i \
https://vault.ius.io/el6/x86_64/packages/p/perl-Git18-1.8.5.5-4.ius.el6.noarch.rpm \
https://vault.ius.io/el6/x86_64/packages/g/git18-1.8.5.5-4.ius.el6.x86_64.rpm
fi
if: startsWith(matrix.container, 'centos')
# TODO: use the current branch instead of @main
- uses: taiki-e/checkout-action@main
- run: git ls-files