CI #469
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- dev | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
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 | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
- os: ubuntu-22.04 | |
- os: ubuntu-20.04 | |
tool1: [email protected] | |
tool2: [email protected] | |
- os: ubuntu-20.04 | |
tool1: [email protected] | |
tool2: [email protected] | |
- os: macos-11 | |
- os: windows-2019 | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
steps: | |
- uses: taiki-e/github-actions/checkout@main | |
- name: Install Rust | |
run: rustup update stable --no-self-update | |
- uses: ./ | |
with: | |
tool: ${{ matrix.tool1 || 'cargo-hack' }} | |
locked: false | |
- run: cargo hack --version | |
- uses: ./ | |
with: | |
tool: ${{ matrix.tool2 || 'cargo-llvm-cov' }} | |
- uses: ./ | |
with: | |
tool: parse-changelog | |
git: https://github.com/taiki-e/parse-changelog | |
rev: d231414 | |
- run: parse-changelog --version | |
- uses: ./ | |
with: | |
tool: cargo-minimal-versions | |
git: https://github.com/taiki-e/cargo-minimal-versions | |
tag: v0.1.19 | |
- run: cargo minimal-versions --version | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell | |
- name: Test bash | |
run: cargo llvm-cov --version | |
shell: bash | |
- name: Test sh | |
run: cargo llvm-cov --version | |
shell: sh | |
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') | |
- name: Test pwsh | |
run: cargo llvm-cov --version | |
shell: pwsh | |
- name: Test powershell | |
run: cargo llvm-cov --version | |
shell: powershell | |
if: startsWith(matrix.os, 'windows') | |
- name: Test cmd | |
run: cargo llvm-cov --version | |
shell: cmd | |
if: startsWith(matrix.os, 'windows') | |
test-container: | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- ubuntu:18.04 # glibc 2.27 | |
- ubuntu:20.04 # glibc 2.31 | |
- ubuntu:22.04 # glibc 2.35 | |
- debian:10-slim # glibc 2.28 | |
- debian:11-slim # glibc 2.31 | |
- debian:12-slim # glibc 2.36 | |
- fedora:latest # glibc 2.37 (as of fedora 38) | |
- almalinux:8 # glibc 2.28 | |
- almalinux:8-minimal # glibc 2.28 | |
- almalinux:9 # glibc 2.34 | |
- almalinux:9-minimal # glibc 2.34 | |
- centos:7 # glibc 2.17 | |
- alpine:latest # musl 1.2.4 (as of alpine 3.19) | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
container: ${{ matrix.container }} | |
steps: | |
- name: Install requirements (ubuntu/debian) | |
run: | | |
set -eEuxo pipefail | |
apt-get -o Acquire::Retries=10 -qq update | |
apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends ca-certificates curl gcc libc6-dev | |
curl --proto '=https' --tlsv1.2 -fsSL --retry 10 https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --no-modify-path | |
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}" | |
apt-get -qq -o Dpkg::Use-Pty=0 remove -y curl | |
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian') | |
- name: Install requirements (fedora/almalinux/centos) | |
run: | | |
set -eEuxo pipefail | |
if type -P dnf &>/dev/null; then | |
dnf install -y gcc | |
elif type -P microdnf &>/dev/null; then | |
microdnf install -y gcc | |
else | |
yum install -y gcc | |
fi | |
curl --proto '=https' --tlsv1.2 -fsSL --retry 10 https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --no-modify-path | |
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}" | |
if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'almalinux') || startsWith(matrix.container, 'centos') | |
- name: Install requirements (alpine) | |
run: apk --no-cache add bash cargo | |
shell: sh | |
if: startsWith(matrix.container, 'alpine') | |
- uses: taiki-e/github-actions/checkout@main | |
- uses: ./ | |
with: | |
tool: cargo-hack | |
locked: false | |
- run: cargo hack --version | |
- uses: ./ | |
with: | |
tool: cargo-llvm-cov | |
- run: cargo llvm-cov --version |