-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-prepare SQLX queries to simplify bundler CI
- Loading branch information
Showing
5 changed files
with
73 additions
and
40 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 |
---|---|---|
|
@@ -9,21 +9,16 @@ jobs: | |
permissions: | ||
contents: read | ||
packages: write | ||
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 | ||
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 | ||
|
||
|
@@ -46,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 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 |
---|---|---|
|
@@ -6,23 +6,16 @@ on: | |
jobs: | ||
build: | ||
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: 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: | ||
|
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 |
---|---|---|
|
@@ -6,23 +6,16 @@ on: | |
jobs: | ||
lint: | ||
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: 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: | ||
|
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,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 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