-
Notifications
You must be signed in to change notification settings - Fork 986
GitHub actions #2190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
GitHub actions #2190
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9672db3
CI: Un-travis-ify our scripting for linux/mac
kinnison 5e797b5
CI: Github Actions templates
kinnison 20a24e8
CI: Script to generate github actions workflows
kinnison 5803ad6
CI: Remove vestiges of travis and appveyor
kinnison b34e892
CI: Generate the workflows for everything
kinnison File filter
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
commit b34e892fde2226bf813090190aa0c3bcdad9eed8
There are no files selected for viewing
This file contains hidden or 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
| 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 | ||
| 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 | ||
This file contains hidden or 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
| 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' |
This file contains hidden or 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
| 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' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.shstill works on centos 6 which is the oldest platform (oldest curl etc) which we support.