Skip to content
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

chore(ci): migrate lints/tests to CircleCI #781

Merged
merged 46 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
93d794a
chore(ci): migrate lint job to CircleCI
EverlastingBugstopper Aug 31, 2021
4d6133e
fixup: don't check for nonexistent parameter
EverlastingBugstopper Aug 31, 2021
68d7e03
fixup: add back platform parameters
EverlastingBugstopper Aug 31, 2021
5037caf
wip(ci): xtask test on circle
EverlastingBugstopper Sep 1, 2021
ede08c7
wip(ci): override tmp dir location
EverlastingBugstopper Sep 1, 2021
fa56ec6
wip(ci): place tmp dir in home directory
EverlastingBugstopper Sep 1, 2021
f8c78d0
wip(ci): really place tmp dir in home directory
EverlastingBugstopper Sep 1, 2021
a8b36e3
wip(ci): don't use temp directories in CI
EverlastingBugstopper Sep 1, 2021
f5375bd
Revert "wip(ci): don't use temp directories in CI"
EverlastingBugstopper Sep 1, 2021
a2dd6db
wip(ci): setup docker for ubuntu tests
EverlastingBugstopper Sep 1, 2021
96a09ed
wip(ci): separate integration from unit tests
EverlastingBugstopper Sep 1, 2021
2acaf4b
fixup: ci config issue
EverlastingBugstopper Sep 1, 2021
ed07746
wip(ci): install proper rust toolchain
EverlastingBugstopper Sep 1, 2021
60f5001
fixup: node installation
EverlastingBugstopper Sep 1, 2021
93774d7
fixup: install specific node version
EverlastingBugstopper Sep 1, 2021
ce86d91
fixup: add back rust installation
EverlastingBugstopper Sep 1, 2021
5e2774b
wip(ci): use volta to install node
EverlastingBugstopper Sep 2, 2021
1759e67
wip(ci): dont use bash env for volta
EverlastingBugstopper Sep 2, 2021
97fc898
wip(ci): use exact path to volta bin
EverlastingBugstopper Sep 2, 2021
fa0b4ce
wip(ci): move platform specific stuff to commands
EverlastingBugstopper Sep 2, 2021
58220f0
wip(ci): further cleanup
EverlastingBugstopper Sep 2, 2021
59db411
wip(ci): dont try $ substitution
EverlastingBugstopper Sep 2, 2021
575014b
wip(ci): add back BASH_ENV
EverlastingBugstopper Sep 2, 2021
b6fcc75
wip(ci): try sh instead of bash
EverlastingBugstopper Sep 2, 2021
75ead03
wip(ci): use volta's skip-setup flag
EverlastingBugstopper Sep 2, 2021
dc06a83
wip(ci): just use the base node image
EverlastingBugstopper Sep 2, 2021
b9d19ec
fixup: use the right image name
EverlastingBugstopper Sep 2, 2021
92093d2
fixup: back to the orb
EverlastingBugstopper Sep 2, 2021
3310638
fixup: correct image
EverlastingBugstopper Sep 2, 2021
5594375
fixup: broken link
EverlastingBugstopper Sep 2, 2021
5d87595
chore(ci): add macos to test matrix
EverlastingBugstopper Sep 2, 2021
cf93bbf
fixup: add parameter to exec_xtask
EverlastingBugstopper Sep 2, 2021
52b063a
fixup: add XTASK_TARGET to macos executor
EverlastingBugstopper Sep 2, 2021
dbd16f8
wip(ci): use xl machines so cc doesn't OOM
EverlastingBugstopper Sep 2, 2021
3d3a724
chore(ci): add windows to test matrix
EverlastingBugstopper Sep 2, 2021
56ddd88
fixup: use windows.xlarge
EverlastingBugstopper Sep 2, 2021
7894cbf
chore(ci): install rust for windows
EverlastingBugstopper Sep 2, 2021
1bf0e7e
fixup: set XTASK_TARGET for windows
EverlastingBugstopper Sep 2, 2021
0012299
wip(test): try setting windows shell to bash
EverlastingBugstopper Sep 2, 2021
6bfccfc
keep it windowsy
EverlastingBugstopper Sep 2, 2021
adab790
use medium macos executor
EverlastingBugstopper Sep 2, 2021
58b4482
chore(ci): updates step names
EverlastingBugstopper Sep 13, 2021
7e2712d
fixup: require workflow
EverlastingBugstopper Sep 13, 2021
44e6f99
chore(ci): removes tests from GH actions
EverlastingBugstopper Sep 13, 2021
cf82f91
chore(ci): remove accidentally committed volta.sh
EverlastingBugstopper Sep 13, 2021
eb8832a
chore(ci): small cleanup
EverlastingBugstopper Sep 13, 2021
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
225 changes: 225 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
version: 2.1

# Our CircleCI dependencies
orbs:
rust: circleci/[email protected]
gh: circleci/[email protected]
node: circleci/[email protected]

# The main workflows executed for Rover
workflows:
lint:
jobs:
- xtask:
name: Lint (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [ubuntu_gnu_docker]
rust_channel: [stable]
command: [lint]
test:
jobs:
- xtask:
name: Cargo tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [ubuntu_gnu_docker, ubuntu_musl, macos, windows]
rust_channel: [stable]
command: [unit-test]

- xtask:
name: Supergraph demo tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [ubuntu_gnu_vm]
rust_channel: [stable]
command: [integration-test]
requires:
- Cargo tests (<< matrix.rust_channel >> rust on ubuntu_gnu_docker)

jobs:
xtask:
parameters:
rust_channel:
type: enum
enum: ["stable", "nightly"]
default: stable
platform:
type: executor
command:
type: enum
enum: ["lint", "unit-test", "integration-test"]
executor: << parameters.platform >>
steps:
- checkout
- install_system_deps:
platform: << parameters.platform >>
rust_channel: << parameters.rust_channel >>
- exec_xtask:
command: << parameters.command >>
platform: << parameters.platform >>

# The machines we use to run our workflows on
executors:
ubuntu_gnu_docker: &ubuntu_gnu_docker_executor
docker:
- image: cimg/base:stable
resource_class: xlarge
environment:
XTASK_TARGET: "x86_64-unknown-linux-gnu"

# This is only used to run supergraph-demo since you can't run Docker from Docker
ubuntu_gnu_vm: &ubuntu_gnu_vm_executor
machine:
image: ubuntu-1604:202104-01
resource_class: xlarge
environment:
XTASK_TARGET: "x86_64-unknown-linux-gnu"

ubuntu_musl: &ubuntu_musl_executor
docker:
- image: cimg/base:stable
resource_class: xlarge
environment:
XTASK_TARGET: "x86_64-unknown-linux-musl"

macos: &macos_executor
macos:
xcode: "11.4"
resource_class: medium
environment:
XTASK_TARGET: "x86_64-apple-darwin"

windows: &windows_executor
machine:
image: 'windows-server-2019-vs2019:stable'
resource_class: windows.xlarge
shell: powershell.exe -ExecutionPolicy Bypass
environment:
XTASK_TARGET: "x86_64-pc-windows-msvc"

# reusable command snippets can be referred to in any `steps` object
commands:
install_system_deps:
parameters:
platform:
type: executor
rust_channel:
type: enum
enum: ["stable", "nightly"]
steps:
- when:
condition:
or:
- equal: [ *ubuntu_gnu_docker_executor, << parameters.platform >> ]
- equal: [ *ubuntu_gnu_vm_executor, << parameters.platform >> ]
- equal: [ *ubuntu_musl_executor, << parameters.platform >> ]
steps:
- run:
name: Update apt repositories
command: sudo apt-get update
- run:
name: Install OpenSSL
command: sudo apt-get install -y libssl-dev
- when:
condition:
equal: [ *ubuntu_musl_executor, << parameters.platform >> ]
steps:
- run:
name: Install musl-tools
command: sudo apt-get install -y musl-tools
- when:
condition:
equal: [ *ubuntu_gnu_docker_executor, << parameters.platform >> ]
steps:
- node/install:
node-version: "14.17.1"
npm-version: "7.21.1"
- when:
condition:
equal: [ *macos_executor, << parameters.platform >> ]
steps:
- run:
name: Install [email protected]
command: brew install [email protected]
- run:
name: Install p7zip
command: brew install p7zip
- install_rust_toolchain:
rust_channel: << parameters.rust_channel >>
platform: << parameters.platform >>

install_rust_toolchain:
parameters:
rust_channel:
type: enum
enum: ["stable", "nightly"]
platform:
type: executor
steps:
- unless:
condition:
equal: [ *windows_executor, << parameters.platform >> ]
steps:
- rust/install:
version: << parameters.rust_channel >>
- run:
name: Install specific rust toolchain
command: rustup target add $XTASK_TARGET
- when:
condition:
equal: [ *windows_executor, << parameters.platform >> ]
steps:
- run:
name: Install rustup
environment:
# Override auto-detection of RAM for rustc install.
# https://github.com/rust-lang/rustup/issues/2229#issuecomment-585855925
RUSTUP_UNPACK_RAM: "21474836480"
command: |
$installer_dir = "$Env:TEMP"
echo "Downloading rustup"
(New-Object System.Net.WebClient).DownloadFile("https://win.rustup.rs/x86_64", "$installer_dir\rustup-init.exe")
echo "Installing rustup"
& $installer_dir\rustup-init.exe --profile minimal -y
exit $LASTEXITCODE
- run:
name: Configure cargo for Windows
command: |
Add-Content -path "${Env:USERPROFILE}\.cargo\config.toml" @"
[net]
git-fetch-with-cli = true
"@

exec_xtask:
parameters:
command:
type: enum
enum: [lint, integration-test, unit-test]
platform:
type: executor
steps:
- restore_cache:
keys:
- rust-target-v1-<< parameters.platform >>-{{ checksum "Cargo.lock" }}
- when:
condition:
# cargo xtask lint is the only xtask command that doesn't take a target
equal: [ lint, << parameters.command >> ]
steps:
- run:
name: cargo xtask << parameters.command >>
command: cargo xtask << parameters.command >> --verbose
- when:
condition:
not:
equal: [ lint, << parameters.command >> ]
steps:
- run:
name: cargo xtask << parameters.command >>
command: cargo xtask << parameters.command >> --target $XTASK_TARGET --verbose
- save_cache:
key: rust-target-v1-<< parameters.platform >>-{{ checksum "Cargo.lock" }}
paths:
- target/

40 changes: 0 additions & 40 deletions .github/workflows/lint.yml

This file was deleted.

104 changes: 0 additions & 104 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ See [this page](https://go.apollo.dev/r/contributing) for info about contributin

## License

This project is licensed under the MIT License ([LICENSE] or http://opensource.org/licenses/MIT).
This project is licensed under the MIT License ([LICENSE] or https://opensource.org/licenses/MIT).

[LICENSE]: https://github.com/apollographql/rover/blob/main/LICENSE
2 changes: 1 addition & 1 deletion installers/binstall/scripts/nix/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Licensed under the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

Expand Down
2 changes: 1 addition & 1 deletion installers/binstall/scripts/windows/install.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Licensed under the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

Expand Down
Loading