-
Notifications
You must be signed in to change notification settings - Fork 5
Refactor CI using central flow #230
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
Changes from all commits
Commits
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
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 |
|---|---|---|
| @@ -1,30 +1,24 @@ | ||
| name: Bundler Container | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build_publish: | ||
| # Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| services: | ||
| ispyb: | ||
| image: ghcr.io/diamondlightsource/ispyb-database:v3.0.0 | ||
| env: | ||
| MARIADB_ROOT_PASSWORD: rootpassword | ||
| options: > | ||
| --health-cmd "/usr/local/bin/healthcheck.sh --defaults-file=/ispyb/.my.cnf --connect" | ||
| ports: | ||
| - 3306:3306 | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Download Prepared Queries Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: prepared-queries | ||
| path: bundler/.sqlx | ||
|
|
||
| - name: Generate Image Name | ||
| run: echo IMAGE_REPOSITORY=ghcr.io/$(echo "${{ github.repository }}-bundler" | tr '[:upper:]' '[:lower:]' | tr '[_]' '[\-]') >> $GITHUB_ENV | ||
|
|
||
|
|
@@ -47,13 +41,10 @@ jobs: | |
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/[email protected] | ||
| with: | ||
| driver-opts: network=host | ||
|
|
||
| - name: Build & Publish Image | ||
| uses: docker/[email protected] | ||
| with: | ||
| build-args: DATABASE_URL=mysql://root:rootpassword@localhost:3306/ispyb_build | ||
| context: bundler/ | ||
| push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | ||
| load: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }} | ||
|
|
||
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,45 @@ | ||
| name: Bundler Docs | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Download Prepared Queries Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: prepared-queries | ||
| path: bundler/.sqlx | ||
|
|
||
| - name: Install stable toolchain | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| toolchain: stable | ||
| default: true | ||
|
|
||
| - name: Cache Rust Build | ||
| uses: Swatinem/[email protected] | ||
|
|
||
| - name: Build docs | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| command: doc | ||
| args: > | ||
| --no-deps | ||
| --all-features | ||
| --document-private-items | ||
| --manifest-path bundler/Cargo.toml | ||
|
|
||
| - name: Fix file permissions for pages | ||
| run: chmod -R +rX bundler/target/doc | ||
|
|
||
| - name: Upload Bundler Docs Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: bundler-docs | ||
| path: bundler/target/doc/bundler | ||
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,48 @@ | ||
| name: Bundler Lint | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Download Prepared Queries Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: prepared-queries | ||
| path: bundler/.sqlx | ||
|
|
||
| - name: Install stable toolchain | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| toolchain: stable | ||
| default: true | ||
|
|
||
| - name: Cache Rust Build | ||
| uses: Swatinem/[email protected] | ||
|
|
||
| - name: Check Formatting | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| command: fmt | ||
| args: > | ||
| --manifest-path bundler/Cargo.toml | ||
| --all | ||
| --check | ||
|
|
||
| - name: Lint with Clippy | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| command: clippy | ||
| args: > | ||
| --manifest-path bundler/Cargo.toml | ||
| --all-targets | ||
| --all-features | ||
| --no-deps | ||
| -- | ||
| --deny warnings | ||
|
|
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,47 @@ | ||
| name: Bundler SQLX | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| prepare: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| ispyb: | ||
| image: ghcr.io/diamondlightsource/ispyb-database:v3.0.0 | ||
| ports: | ||
| - 3306:3306 | ||
| env: | ||
| MARIADB_ROOT_PASSWORD: rootpassword | ||
| options: >- | ||
| --health-cmd "/usr/local/bin/healthcheck.sh --defaults-file=/ispyb/.my.cnf --connect" | ||
| --health-interval 1s | ||
| --health-retries 60 | ||
| env: | ||
| DATABASE_URL: mysql://root:rootpassword@localhost/ispyb_build | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Install stable toolchain | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| toolchain: stable | ||
| default: true | ||
|
|
||
| - name: Cache Rust Build | ||
| uses: Swatinem/[email protected] | ||
|
|
||
| - name: Install SQLX CLI | ||
| run: cargo install sqlx-cli | ||
|
|
||
| - name: Prepare SQLX Query | ||
| working-directory: bundler | ||
| run: cargo sqlx prepare | ||
|
|
||
| - name: Upload Prepared Queries Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: prepared-queries | ||
| path: bundler/.sqlx | ||
| include-hidden-files: true |
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,42 @@ | ||
| name: Bundler Test | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| ispyb: | ||
| image: ghcr.io/diamondlightsource/ispyb-database:v3.0.0 | ||
| ports: | ||
| - 3306:3306 | ||
| env: | ||
| MARIADB_ROOT_PASSWORD: rootpassword | ||
| options: >- | ||
| --health-cmd "/usr/local/bin/healthcheck.sh --defaults-file=/ispyb/.my.cnf --connect" | ||
| --health-interval 1s | ||
| --health-retries 60 | ||
| env: | ||
| DATABASE_URL: mysql://root:rootpassword@localhost/ispyb_build | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Install stable toolchain | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| toolchain: stable | ||
| default: true | ||
|
|
||
| - name: Cache Rust Build | ||
| uses: Swatinem/[email protected] | ||
|
|
||
| - name: Test | ||
| uses: actions-rs/[email protected] | ||
| with: | ||
| command: test | ||
| args: > | ||
| --manifest-path bundler/Cargo.toml | ||
| --all-targets | ||
| --all-features |
5 changes: 1 addition & 4 deletions
5
.github/workflows/devcontainer.yml → .github/workflows/_devcontainer.yaml
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
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,31 @@ | ||
| name: Docs Build | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/[email protected] | ||
| with: | ||
| python-version: 3.12 | ||
|
|
||
| - name: Install Python Dependencies | ||
| run: pip install -r docs/requirements.txt | ||
|
|
||
| - name: Build User Docs | ||
| run: mkdocs build | ||
|
|
||
| - name: Fix file permissions for pages | ||
| run: chmod -R +rX site | ||
|
|
||
| - name: Upload User Docs Artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: user-docs | ||
| path: site |
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,26 @@ | ||
| name: Docs Lint | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/[email protected] | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Install Yarn dependencies | ||
| uses: borales/[email protected] | ||
| with: | ||
| cmd: global add markdownlint-cli2 markdown-it-admon | ||
|
|
||
| - name: Lint with markdownlint-cli2 | ||
| run: > | ||
| markdownlint-cli2 | ||
| **/*.{md,markdown} |
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,27 @@ | ||
| name: Helm Charts Lint | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Helm | ||
| uses: azure/setup-helm@v4 | ||
|
|
||
| - name: Setup chart-testing | ||
| uses: helm/[email protected] | ||
|
|
||
| - name: Lint | ||
| run: > | ||
| ct | ||
| lint | ||
| --target-branch=${{ github.event.repository.default_branch }} | ||
| --validate-maintainers=false | ||
|
|
32 changes: 3 additions & 29 deletions
32
.github/workflows/helm-charts.yml → .github/workflows/_helm_chart_publish.yaml
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 |
|---|---|---|
| @@ -1,36 +1,10 @@ | ||
| name: Helm Charts | ||
| name: Helm Charts Publish | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
| # Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/[email protected] | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Helm | ||
| uses: azure/setup-helm@v4 | ||
|
|
||
| - name: Setup chart-testing | ||
| uses: helm/[email protected] | ||
|
|
||
| - name: Lint | ||
| run: > | ||
| ct | ||
| lint | ||
| --target-branch=${{ github.event.repository.default_branch }} | ||
| --validate-maintainers=false | ||
|
|
||
| build_publish: | ||
| # Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.