mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-09 18:11:48 +08:00
152 lines
7.3 KiB
YAML
152 lines
7.3 KiB
YAML
name: CI
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
schedule:
|
|
- cron: '0 1 * * *'
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
tidy:
|
|
uses: taiki-e/workflows/.github/workflows/tidy-rust.yml@main
|
|
|
|
test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-20.04
|
|
- ubuntu-22.04
|
|
tool:
|
|
# cargo-watch is supported by cargo-binstall (through quickinstall)
|
|
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,valgrind,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
include:
|
|
# Note: Specifying the version of valgrind and cargo-binstall is not supported.
|
|
- os: ubuntu-20.04
|
|
tool: cargo-hack@0.5.24,cargo-llvm-cov@0.5.3,cargo-minimal-versions@0.1.8,parse-changelog@0.5.2,cargo-udeps@0.1.35,cargo-valgrind@2.1.0,cargo-deny@0.13.5,cross@0.2.4,nextest@0.9.11,protoc@3.21.12,shellcheck@0.9.0,shfmt@3.6.0,wasm-pack@0.10.3,wasmtime@4.0.0,mdbook@0.4.25,mdbook-linkcheck@0.7.7,cargo-watch@8.1.1
|
|
- os: ubuntu-20.04
|
|
tool: cargo-hack@0.5,cargo-llvm-cov@0.5,cargo-minimal-versions@0.1,parse-changelog@0.5,cargo-udeps@0.1,cargo-valgrind@2.1,cargo-deny@0.13,cross@0.2,nextest@0.9,protoc@3.21,shellcheck@0.9,shfmt@3.5,wasm-pack@0.10,wasmtime@4.0,mdbook@0.4,mdbook-linkcheck@0.7,cargo-watch@8.1
|
|
- os: ubuntu-20.04
|
|
tool: cargo-valgrind@2,protoc@3,shfmt@3,wasmtime@4,cargo-watch@8
|
|
- os: macos-11
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
- os: windows-2019
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
persist-credentials: false
|
|
# cross attempts to install rust-src when Cargo.toml is available even if `cross --version`
|
|
- run: rm Cargo.toml
|
|
- uses: ./
|
|
with:
|
|
tool: ${{ matrix.tool }}
|
|
|
|
test-container:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
container:
|
|
- ubuntu:18.04 # glibc 2.27
|
|
- ubuntu:20.04 # glibc 2.31
|
|
- debian:10-slim # glibc 2.28
|
|
- debian:11-slim # glibc 2.31
|
|
- rockylinux:8 # glibc 2.28
|
|
- rockylinux:8-minimal # glibc 2.28
|
|
tool:
|
|
# valgrind: installing snap to container is difficult...
|
|
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-udeps,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
include:
|
|
- container: ubuntu:22.04 # glibc 2.35
|
|
# cargo-udeps depends on openssl 1.1
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
- container: fedora:latest # glibc 2.36 (as of fedora 37)
|
|
# cargo-udeps depends on openssl 1.1
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,protoc,shellcheck,shfmt,wasm-pack,wasmtime,mdbook,mdbook-linkcheck,cargo-watch
|
|
- container: centos:7 # glibc 2.17
|
|
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
|
|
# we don't support nextest on very old glibc due to https://github.com/taiki-e/install-action/issues/13.
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
|
|
- container: alpine:latest # musl 1.2.3 (as of alpine 3.17)
|
|
# cargo-udeps,protoc,valgrind,wasmtime,mdbook-linkcheck,cargo-watch don't provide prebuilt binaries for musl host.
|
|
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cargo-valgrind,cargo-deny,cross,nextest,shellcheck,shfmt,wasm-pack,mdbook,cargo-binstall
|
|
runs-on: ubuntu-latest
|
|
container: ${{ matrix.container }}
|
|
steps:
|
|
- name: Install requirements (ubuntu/debian)
|
|
run: |
|
|
set -euxo pipefail
|
|
apt-get -o Acquire::Retries=10 -qq update
|
|
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo
|
|
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
|
|
- name: Install requirements (fedora/rockylinux)
|
|
run: |
|
|
set -euxo pipefail
|
|
dnf=dnf
|
|
if ! type -P dnf &>/dev/null; then
|
|
dnf=microdnf
|
|
fi
|
|
# tar and gzip are required for actions/checkout on rockylinux:*-minimal
|
|
$dnf install -y cargo tar gzip
|
|
if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'rockylinux')
|
|
- name: Install requirements (centos)
|
|
run: |
|
|
set -euxo pipefail
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
|
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}"
|
|
if: startsWith(matrix.container, 'centos')
|
|
- name: Install requirements (alpine)
|
|
run: |
|
|
set -eux
|
|
apk add bash cargo
|
|
shell: sh
|
|
if: startsWith(matrix.container, 'alpine')
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
persist-credentials: false
|
|
# cross attempts to install rust-src when Cargo.toml is available even if `cross --version`
|
|
- run: rm Cargo.toml
|
|
- uses: ./
|
|
with:
|
|
tool: ${{ matrix.tool }}
|
|
|
|
manifest:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # TODO test
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
persist-credentials: false
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
- run: tools/manifest.sh
|
|
- run: git add -N . && git diff --exit-code
|
|
if: github.repository_owner != 'taiki-e' || github.event_name != 'schedule' && !(github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
- id: diff
|
|
run: ci/manifest.sh
|
|
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
- uses: taiki-e/create-pull-request@v4
|
|
with:
|
|
title: Update manifest
|
|
body: |
|
|
Auto-generated by [create-pull-request][1]
|
|
[Please close and immediately reopen this pull request to run CI.][2]
|
|
|
|
[1]: https://github.com/peter-evans/create-pull-request
|
|
[2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
|
|
branch: update-manifest
|
|
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
|