Skip to content

Commit

Permalink
Add WIP CI integration, registrations config key
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Jul 18, 2023
1 parent cf334e6 commit b7cd859
Show file tree
Hide file tree
Showing 18 changed files with 799 additions and 545 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# 🐻‍❄️📦 charted-server: Free, open source, and reliable Helm Chart registry made in Rust
# Copyright 2022-2023 Noelware, LLC. <team@noelware.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: CI
on:
workflow_dispatch: {}
push:
branches:
- 'issues/gh-**'
- 'feat/**'
- main
paths-ignore:
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- 'scripts/**'
- '.*ignore'
- '**.md'
- renovate.json
- LICENSE
pull_request:
types: [synchronize]
paths-ignore:
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- 'scripts/**'
- '.*ignore'
- '**.md'
- renovate.json
- LICENSE
jobs:
ci:
name: Rust CI
runs-on: ${{matrix.runner}}
strategy:
fail-fast: true
matrix:
runner: [windows-latest, macos-latest, ubuntu-latest, self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Bazel cache
uses: actions/cache@v3
with:
path: |
~/.cache/bazelisk
~/.cache/bazel
key: bazel-cache-${{matrix.runner}}-${{ hashFiles('WORKSPACE', 'BUILD.bazel') }}
restore-keys: bazel-cache-${{matrix.runner}}-

- name: Sync dependencies
run: bazel sync --only=crate_index
env:
CARGO_BAZEL_REPIN: all

- name: Build project
run: bazel build //:cli

- name: Run rustfmt
run: bazel run @rules_rust//:rustfmt

- name: Run tests
run: bazel test //...
# node-ci:
# name: Node.js CI [web]
# runs-on: ${{matrix.runner}}
# strategy:
# fail-fast: true
# matrix:
# runner: [windows-latest, macos-latest, ubuntu-latest, self-hosted]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Setup Bazel cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.cache/bazelisk
# ~/.cache/bazel
# key: bazel-cache-nodejs-${{matrix.runner}}-${{ hashFiles('WORKSPACE', 'web/BUILD.bazel') }}
# restore-keys: bazel-cache-nodejs-${{matrix.runner}}-
87 changes: 87 additions & 0 deletions .github/workflows/OpenAPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 🐻‍❄️📦 charted-server: Free, open source, and reliable Helm Chart registry made in Rust
# Copyright 2022-2023 Noelware, LLC. <team@noelware.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Generate OpenAPI document
on:
workflow_dispatch: {}
push:
branches:
- main
paths-ignore:
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- 'scripts/**'
- '.*ignore'
- '**.md'
- renovate.json
- LICENSE
pull_request:
types: [synchronize]
paths-ignore:
- '.coder/**'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- 'scripts/**'
- '.*ignore'
- '**.md'
- renovate.json
- LICENSE
jobs:
openapi:
name: Generate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install Prettier
run: npm i -g prettier

- name: Setup Bazel cache
uses: actions/cache@v3
with:
path: |
~/.cache/bazelisk
~/.cache/bazel
key: bazel-cache-ubuntu-latest-${{ hashFiles('WORKSPACE', 'BUILD.bazel') }}
restore-keys: bazel-cache-ubuntu-latest-

- name: Sync dependencies
run: bazel sync --only=crate_index
env:
CARGO_BAZEL_REPIN: all

- name: Generate document and format
run: |
rm ${GITHUB_WORKSPACE}/assets/openapi.json
bazel run //:cli -- openapi ${GITHUB_WORKSPACE}/assets/openapi.json
prettier --write --config ${GITHUB_WORKSPACE}/web/.prettierrc.json ./assets/openapi.json
- name: Commit changes (if we can)
uses: EndBug/add-and-commit@v9
with:
author_name: Noel[bot]
default_author: user_info
author_email: noelbot@users.noreply.github.com
message: '[skip ci] :sparkles: Update OpenAPI spec'
push: true
24 changes: 24 additions & 0 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 🐻‍❄️📦 charted-server: Free, open source, and reliable Helm Chart registry made in Rust
# Copyright 2022-2023 Noelware, LLC. <team@noelware.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release CI (Stable)
on:
release:
types: [published]
jobs:
binary:
runs-on: ubuntu-latest
steps:
- run: echo woof
25 changes: 25 additions & 0 deletions .github/workflows/ReleaseBeta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 🐻‍❄️📦 charted-server: Free, open source, and reliable Helm Chart registry made in Rust
# Copyright 2022-2023 Noelware, LLC. <team@noelware.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release CI (Beta)
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-beta(\.[0-9]+)?'
jobs:
binary:
runs-on: ubuntu-latest
steps:
- run: echo woof
25 changes: 25 additions & 0 deletions .github/workflows/ReleaseNightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 🐻‍❄️📦 charted-server: Free, open source, and reliable Helm Chart registry made in Rust
# Copyright 2022-2023 Noelware, LLC. <team@noelware.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release CI (Nightly)
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-nightly(\.[0-9]+)?'
jobs:
binary:
runs-on: ubuntu-latest
steps:
- run: echo woof
Loading

0 comments on commit b7cd859

Please sign in to comment.