This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add proper CI with auto-publish (#18)
* feat: Add proper CI with auto-publish * chore: Trigger circleCI * feat: Set rust toolchain to use * chore: Rename rust-toolchain.toml -> rust-toolchain * fix: Don't trigger release-please in monorepo mode * chore: Remove sccache for now
- Loading branch information
1 parent
a8ae63c
commit 4688f53
Showing
7 changed files
with
141 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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,46 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
version: 2 | ||
rust: | ||
jobs: | ||
- lint: | ||
context: [shared-secrets] | ||
- test: | ||
context: [shared-secrets] | ||
|
||
jobs: | ||
lint: | ||
description: Run lints | ||
executor: rust/medium | ||
steps: | ||
- checkout | ||
- run: | ||
name: Check formatting | ||
command: cargo fmt -- --check | ||
- run: | ||
name: Lint with clippy | ||
environment: | ||
RUSTFLAGS: -Dwarnings | ||
command: cargo clippy --all-features -- -D warnings | ||
|
||
test: | ||
description: Run unit tests | ||
executor: rust/medium | ||
steps: | ||
- checkout | ||
- run: | ||
name: Run unit tests | ||
command: cargo test --all-features | ||
|
||
orbs: | ||
rust: | ||
executors: | ||
medium: | ||
description: "Rust Executor" | ||
docker: | ||
- image: gcr.io/netlify-services/circleci-rust:main | ||
auth: | ||
username: _json_key | ||
password: $GCLOUD_SERVICE_KEY | ||
resource_class: medium |
This file contains 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,38 @@ | ||
name: PR conventions | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
label-pr: | ||
name: Auto-label PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: netlify/pr-labeler-action@v1.0.0 | ||
if: startsWith(github.event.pull_request.title, 'fix') | ||
with: | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
label: "type: bug" | ||
- uses: netlify/pr-labeler-action@v1.0.0 | ||
if: startsWith(github.event.pull_request.title, 'chore') | ||
with: | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
label: "type: chore" | ||
- uses: netlify/pr-labeler-action@v1.0.0 | ||
if: startsWith(github.event.pull_request.title, 'feat') | ||
with: | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
label: "type: feature" | ||
|
||
lint: | ||
name: Lint PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v3.4.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
validateSingleCommit: true |
This file contains 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,23 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
name: Release Please | ||
|
||
jobs: | ||
crates: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v2 | ||
id: release | ||
with: | ||
token: ${{ secrets.PKG_RELEASE_TOKEN }} | ||
release-type: rust | ||
package-name: netlify_toml | ||
|
||
- uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Publish crate | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} |
This file contains 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,26 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [edited] | ||
schedule: | ||
# every hour | ||
- cron: 0 * * * * | ||
|
||
name: Renovate | ||
|
||
jobs: | ||
check_dependencies: | ||
name: Check dependencies | ||
runs-on: ubuntu-20.04 | ||
if: | | ||
(github.event_name != 'pull_request') || startsWith(github.head_ref, 'renovate/') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Renovate repository | ||
uses: netlify/renovate-cli-action@v1 | ||
with: | ||
github-token: ${{ secrets.PKG_RELEASE_TOKEN }} | ||
git-author: "Renovate Bot <statusbot@netlify.com>" |
This file was deleted.
Oops, something went wrong.
This file contains 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,4 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["github>netlify/renovate-rust-preset"] | ||
} |
This file contains 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,4 @@ | ||
[toolchain] | ||
channel = "1.50.0" | ||
components = [ "rustfmt", "clippy" ] | ||
targets = [ "x86_64-unknown-linux-gnu" ] |