Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CI: Generate the workflows for everything
These are the workflows generated by running:

sh ci/actions-templates/gen-workflows.sh

Signed-off-by: Daniel Silverstone <[email protected]>
  • Loading branch information
kinnison committed Jan 7, 2020
commit b34e892fde2226bf813090190aa0c3bcdad9eed8
93 changes: 93 additions & 0 deletions .github/workflows/centos-fmt-clippy-on-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This is ci/actions-templates/centos-fmt-clippy.yaml
# Do not edit this file in .github/workflows

name: Centos checks, formatting, clippy, and shellcheck, of Rustup

on:
pull_request:
branches:
- "*"
push:
branches:
- master
- stable
schedule:
- cron: "30 0 * * 1" # Every Monday at half past midnight

jobs:
check:
name: Checks
runs-on: ubuntu-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name and file name claims to check on centos. This metadata says it checks on ubuntu. I think that this is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if it does check on centos a comment would help

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The centos check is done in a docker in one of the actions. fmt, clippy, and shellcheck are not done on centos.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to patch the texts to make things nicer, please file a PR, this was the culmination of two days of frustration, so it's not the prettiest it could be yet :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure I understand it all yet. What is a 'centos check' vs say a shellcheck run on centos?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the centos check is the docker run where we validate that rustup-init.sh still works on centos 6 which is the oldest platform (oldest curl etc) which we support.

strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
- name: Acquire tags for the repo
run: |
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
- name: Display the current git status
run: |
git status
git describe
- name: Prep cargo dirs
run: |
mkdir -p ~/.cargo/{registry,git}
- name: Set environment variables appropriately for the build
run: |
echo "::add-path::$HOME/.cargo/bin"
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-clippy-beta-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rustup using ./rustup-init.sh
run: |
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
- name: Ensure Beta is up to date
run: |
if rustc +beta -vV >/dev/null 2>/dev/null; then
rustup toolchain uninstall beta
fi
rustup toolchain install --profile=minimal beta
rustup default beta
- name: Ensure we have the components we need
run: |
rustup component add rustfmt
rustup component add clippy
- name: Run the centos check within the docker image
run: |
HERE=$(pwd)
docker run \
--volume "$HERE":/checkout:ro \
--workdir /checkout \
--tty \
--init \
--rm \
centos:6 \
sh ./ci/raw_init.sh
- name: Run shell checks
run: |
shellcheck -s dash -- rustup-init.sh
git ls-files -- '*.sh' | xargs shellcheck -s dash -e SC1090
git ls-files -- '*.bash' | xargs shellcheck -s bash -e SC1090
- name: Run formatting checks
run: |
cargo fmt --all -- --check
- name: Run cargo check and clippy
run: |
cargo check --all --all-targets
git ls-files -- '*.rs' | xargs touch
cargo clippy --all --all-targets
132 changes: 132 additions & 0 deletions .github/workflows/linux-builds-on-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# This is ci/actions-templates/linux-builds-template.yaml
# Do not edit this file in .github/workflows

name: Linux-hosted builds of Rustup (master) # skip-pr skip-stable

on:
push: # skip-pr
branches: # skip-pr
- master # skip-pr skip-stable
schedule: # skip-pr skip-stable
- cron: "30 0 * * 1" # Every Monday at half past midnight UTC skip-pr skip-stable

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
- aarch64-unknown-linux-gnu # skip-pr
- powerpc64-unknown-linux-gnu # skip-pr
- x86_64-unknown-linux-musl # skip-pr
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
steps:
- uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
- name: Acquire tags for the repo
run: |
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
- name: Display the current git status
run: |
git status
git describe
- name: Prep cargo dirs
run: |
mkdir -p ~/.cargo/{registry,git}
- name: Set environment variables appropriately for the build
run: |
echo "::add-path::$HOME/.cargo/bin"
echo "::set-env name=TARGET::${{matrix.target}}"
- name: Skip tests
run: |
echo "::set-env name=SKIP_TESTS::yes"
if: matrix.run_tests == ''
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rustup using ./rustup-init.sh
run: |
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
- name: Ensure Stable is up to date
run: |
if rustc +stable -vV >/dev/null 2>/dev/null; then
rustup toolchain uninstall stable
fi
rustup toolchain install --profile=minimal stable
- name: Ensure we have our goal target installed
run: |
rustup target install "$TARGET"
- name: Determine which docker we need to run in
run: |
case "$TARGET" in
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
*) DOCKER="$TARGET" ;;
esac
echo "::set-env name=DOCKER::$DOCKER"
- name: Fetch the docker
run: bash ci/fetch-rust-docker.bash "${TARGET}"
- name: Maybe build a docker from there
run: |
if [ -f "ci/docker/$DOCKER/Dockerfile" ]; then
docker build -t "$DOCKER" -f "ci/docker/${DOCKER}/Dockerfile" .
fi
- name: Run the build within the docker image
run: |
HERE=$(pwd)
mkdir -p "${HERE}/target"
chown -R "$(id -u)":"$(id -g)" "${HERE}/target"
docker run \
--entrypoint sh \
--user "$(id -u)":"$(id -g)" \
--volume "$(rustc --print sysroot)":/rustc-sysroot:ro \
--volume "${HERE}":/checkout:ro \
--volume "${HERE}"/target:/checkout/target \
--workdir /checkout \
--env TARGET="${TARGET}" \
--env SKIP_TESTS="${SKIP_TESTS}" \
--volume "${HOME}/.cargo:/cargo" \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--env LIBZ_SYS_STATIC=1 \
--tty \
--init \
--rm \
"${DOCKER}" \
-c 'PATH="${PATH}":/rustc-sysroot/bin bash ci/run.bash'
- name: Acquire the AWS tooling
run: |
pip3 install -U setuptools
pip3 install awscli
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Prepare the dist
run: |
bash ci/prepare-deploy.bash
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Deploy build to dev-static dist tree for release team
run: |
aws s3 cp --recursive deploy/ s3://dev-static-rust-lang-org/rustup/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
127 changes: 127 additions & 0 deletions .github/workflows/linux-builds-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# This is ci/actions-templates/linux-builds-template.yaml
# Do not edit this file in .github/workflows

name: Linux-hosted builds of Rustup (PR) # skip-master skip-stable

on:
pull_request: # skip-master skip-stable
branches: # skip-master skip-stable
- "*" # skip-master skip-stable

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
include:
- target: x86_64-unknown-linux-gnu
run_tests: YES
steps:
- uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
- name: Acquire tags for the repo
run: |
git fetch --no-tags --prune --depth=1 origin +refs/tags/*:refs/tags/*
- name: Display the current git status
run: |
git status
git describe
- name: Prep cargo dirs
run: |
mkdir -p ~/.cargo/{registry,git}
- name: Set environment variables appropriately for the build
run: |
echo "::add-path::$HOME/.cargo/bin"
echo "::set-env name=TARGET::${{matrix.target}}"
- name: Skip tests
run: |
echo "::set-env name=SKIP_TESTS::yes"
if: matrix.run_tests == ''
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rustup using ./rustup-init.sh
run: |
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
- name: Ensure Stable is up to date
run: |
if rustc +stable -vV >/dev/null 2>/dev/null; then
rustup toolchain uninstall stable
fi
rustup toolchain install --profile=minimal stable
- name: Ensure we have our goal target installed
run: |
rustup target install "$TARGET"
- name: Determine which docker we need to run in
run: |
case "$TARGET" in
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
*) DOCKER="$TARGET" ;;
esac
echo "::set-env name=DOCKER::$DOCKER"
- name: Fetch the docker
run: bash ci/fetch-rust-docker.bash "${TARGET}"
- name: Maybe build a docker from there
run: |
if [ -f "ci/docker/$DOCKER/Dockerfile" ]; then
docker build -t "$DOCKER" -f "ci/docker/${DOCKER}/Dockerfile" .
fi
- name: Run the build within the docker image
run: |
HERE=$(pwd)
mkdir -p "${HERE}/target"
chown -R "$(id -u)":"$(id -g)" "${HERE}/target"
docker run \
--entrypoint sh \
--user "$(id -u)":"$(id -g)" \
--volume "$(rustc --print sysroot)":/rustc-sysroot:ro \
--volume "${HERE}":/checkout:ro \
--volume "${HERE}"/target:/checkout/target \
--workdir /checkout \
--env TARGET="${TARGET}" \
--env SKIP_TESTS="${SKIP_TESTS}" \
--volume "${HOME}/.cargo:/cargo" \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--env LIBZ_SYS_STATIC=1 \
--tty \
--init \
--rm \
"${DOCKER}" \
-c 'PATH="${PATH}":/rustc-sysroot/bin bash ci/run.bash'
- name: Acquire the AWS tooling
run: |
pip3 install -U setuptools
pip3 install awscli
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Prepare the dist
run: |
bash ci/prepare-deploy.bash
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Deploy build to dev-static dist tree for release team
run: |
aws s3 cp --recursive deploy/ s3://dev-static-rust-lang-org/rustup/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
Loading