Skip to content

dev

dev #36

Workflow file for this run

name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
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
codegen:
runs-on: ubuntu-24.04 # old clang doesn't support AArch64 illumos # TODO: use ubuntu-latest once https://github.com/actions/runner-images/issues/10636 done
timeout-minutes: 60
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@nightly
- run: |
retry() {
for i in {1..10}; do
if "$@"; then
return 0
else
sleep "${i}"
fi
done
"$@"
}
retry sudo apt-get -o Acquire::Retries=10 -qq update
retry sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
gcc-i686-linux-gnu \
gcc-m68k-linux-gnu \
gcc-mips-linux-gnu \
gcc-mips64-linux-gnuabi64 \
gcc-mips64el-linux-gnuabi64 \
gcc-mipsel-linux-gnu \
gcc-mipsisa32r6-linux-gnu \
gcc-mipsisa32r6el-linux-gnu \
gcc-mipsisa64r6-linux-gnuabi64 \
gcc-mipsisa64r6el-linux-gnuabi64 \
gcc-powerpc-linux-gnu \
gcc-powerpc64-linux-gnu \
gcc-powerpc64le-linux-gnu \
gcc-riscv64-linux-gnu \
gcc-s390x-linux-gnu \
gcc-sparc64-linux-gnu \
gcc-x86-64-linux-gnux32 \
gettext
mkdir -p -- tmp
retry docker create --name gcc-csky-linux-gnuabiv2 "ghcr.io/taiki-e/rust-cross-toolchain:csky-unknown-linux-gnuabiv2-dev-amd64"
docker cp -- "gcc-csky-linux-gnuabiv2:/csky-unknown-linux-gnuabiv2" tmp/gcc-csky-linux-gnuabiv2
docker rm -f -- gcc-csky-linux-gnuabiv2 >/dev/null
printf '%s\n' "$(pwd)/tmp/gcc-csky-linux-gnuabiv2/bin" >>"${GITHUB_PATH}"
retry docker create --name gcc-loongarch64-linux-gnu "ghcr.io/taiki-e/rust-cross-toolchain:loongarch64-unknown-linux-gnu-dev-amd64"
docker cp -- "gcc-loongarch64-linux-gnu:/loongarch64-unknown-linux-gnu" tmp/gcc-loongarch64-linux-gnu
docker rm -f -- gcc-loongarch64-linux-gnu >/dev/null
printf '%s\n' "$(pwd)/tmp/gcc-loongarch64-linux-gnu/bin" >>"${GITHUB_PATH}"
- run: tools/gen.sh
- id: diff
run: tools/ci/gen.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- id: create-pull-request
uses: peter-evans/create-pull-request@v7
with:
title: Update generated code
body: |
Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
branch: update-generated-code
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Notify PR author by assigning PR
run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- run: git add -N . && git diff --exit-code