-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathconfig.yml
168 lines (152 loc) · 4.32 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
version: 2.1
# Our CircleCI dependencies
orbs:
rust: circleci/rust@1.6.1
secops: apollo/circleci-secops-orb@2.0.7
release: &release
filters:
branches:
ignore: /.*/
tags: # To trigger a release, push a tag with the format `package-name@vversion`. Like `apollo-composition@v0.1.0`
only: /(apollo-federation-types@v.*)|(apollo-composition@v.*)/
parameters:
# we can't easily pin on osx
linux_cmake_version:
type: string
default: '3.27.3'
# The main workflows executed for federation-rs
workflows:
lint:
jobs:
- lint
test:
jobs:
- test:
name: Run cargo tests on << matrix.platform >>
matrix:
parameters:
platform: [ amd_ubuntu, arm_ubuntu, arm_macos ]
release:
jobs:
- test:
name: Run cargo tests on << matrix.platform >>
matrix:
parameters:
platform: [ amd_ubuntu, arm_ubuntu, arm_macos ]
<<: *release
- publish_release:
name: Publish to crates.io
requires:
- "Run cargo tests on amd_ubuntu"
- "Run cargo tests on arm_ubuntu"
- "Run cargo tests on arm_macos"
<<: *release
security-scans:
jobs:
- secops/gitleaks:
context:
- platform-docker-ro
- github-orb
- secops-oidc
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
git-revision: << pipeline.git.revision >>
- secops/semgrep:
context:
- secops-oidc
- github-orb
git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
jobs:
lint:
executor: amd_ubuntu
steps:
- checkout
- install_system_deps:
platform: amd_ubuntu
- run:
name: Check Rust formatting
command: cargo fmt --all -- --check
- run:
name: Check Rust lints
command: cargo clippy --all-features -- -D warnings
test:
parameters:
platform:
type: executor
executor: << parameters.platform >>
steps:
- checkout
- install_system_deps:
platform: << parameters.platform >>
- run:
name: Run cargo tests
command: cargo test
publish_release:
executor: minimal_linux
steps:
- checkout
- rust/install
- run:
name: Publish to crates.io
command: |
# The tag looks like `<package-name>@v<version>`, but cargo wants `<package-name>@<version>`
CARGO_VERSION=$(echo $CIRCLE_TAG | sed 's/@v/@/')
cargo publish -p $CARGO_VERSION
# The machines we use to run our workflows on
executors:
arm_macos: &arm_macos_executor
macos:
xcode: "15.4.0"
resource_class: macos.m1.medium.gen1
environment:
RUSTUP_TARGET: "aarch64-apple-darwin"
APPLE_TEAM_ID: "YQK948L752"
APPLE_USERNAME: "opensource@apollographql.com"
MACOS_PRIMARY_BUNDLE_ID: com.apollographql.supergraph
amd_ubuntu:
machine:
image: ubuntu-2004:current
resource_class: xlarge
environment:
RUSTUP_TARGET: "x86_64-unknown-linux-gnu"
arm_ubuntu:
machine:
image: ubuntu-2004:current
resource_class: arm.large
environment:
RUSTUP_TARGET: "aarch64-unknown-linux-gnu"
minimal_linux:
docker:
- image: cimg/base:stable
resource_class: small
environment:
RUSTUP_TARGET: "x86_64-unknown-linux-gnu"
# reusable command snippets can be referred to in any `steps` object
commands:
install_system_deps:
parameters:
platform:
type: executor
steps:
- when:
condition:
equal: [ *arm_macos_executor, << parameters.platform >> ]
steps:
- run:
name: Install CMake
command: brew install cmake
- install_rust_toolchain:
platform: << parameters.platform >>
install_rust_toolchain:
parameters:
platform:
type: executor
steps:
- rust/install
- run:
name: Adds rust target
command: rustup target add $RUSTUP_TARGET
- run:
name: Set default rustc version
command: |
rustup install stable
rustup default stable