Compare commits

..

30 Commits

Author SHA1 Message Date
cascode _ d85d6285d2 Revert "var for images"
checks / lint (pull_request) Successful in 5s Details
checks / build (pull_request) Successful in 2m15s Details
checks / test (pull_request) Successful in 2m9s Details
This reverts commit 0c3ecb2730.
2023-10-26 17:34:07 -07:00
cascode _ 3e80545d6b var for images 2023-10-26 17:34:07 -07:00
cascode _ b511e5a81a more concise 2023-10-26 17:34:07 -07:00
cascode _ 8b5b5b539b Revert "more concise"
This reverts commit a0e6005acd.
2023-10-26 17:34:07 -07:00
cascode _ f5b7db930d more concise 2023-10-26 17:34:07 -07:00
cascode _ 8e0984e7b1 re-merge file 2023-10-26 17:34:07 -07:00
cascode _ 4957b36355 only run on some path changes 2023-10-26 17:34:07 -07:00
cascode _ 614d7b8a20 remove runner tag 2023-10-26 17:34:07 -07:00
cascode _ c5f723210b try removing runner tag 2023-10-26 17:34:07 -07:00
cascode _ 691afc382d change triggers 2023-10-26 17:34:07 -07:00
cascode _ cd4333cacd change triggers 2023-10-26 17:34:07 -07:00
cascode _ de9d8dde88 reorder triggers 2023-10-26 17:34:07 -07:00
cascode _ 55ec00d1fb only run for push on main, or for pr 2023-10-26 17:34:07 -07:00
cascode _ 05b6ffc807 image changes 2023-10-26 17:34:07 -07:00
cascode _ 7360bba00e add build deps to ci docker image 2023-10-26 17:34:07 -07:00
cascode _ 8c46018fee image changes 2023-10-26 17:34:07 -07:00
cascode _ dc01798dfa names and images changes 2023-10-26 17:34:07 -07:00
cascode _ 2aad6e49cd automated build and test 2023-10-26 17:34:07 -07:00
cascode _ b7c37613ce move some steps into the base image 2023-10-26 17:34:07 -07:00
cascode _ d8b6e31836 fix fmt 2023-10-26 17:34:07 -07:00
cascode _ 0babf35c1e test 2023-10-26 17:34:07 -07:00
cascode _ 57313ddf7c test 2023-10-26 17:34:07 -07:00
cascode _ 5ae1314bb7 add node 2023-10-26 17:34:07 -07:00
cascode _ 0cd0e54b66 add checkout 2023-10-26 17:34:07 -07:00
cascode _ 54db9795fe add debug ls 2023-10-26 17:34:07 -07:00
cascode _ e27d224d3d add debug ls 2023-10-26 17:34:07 -07:00
cascode _ 3b14b93d17 add rustfmt 2023-10-26 17:34:07 -07:00
cascode _ 1c719b3061 Revert "test"
This reverts commit 81158ca818.
2023-10-26 17:34:07 -07:00
cascode _ cab056ea69 test 2023-10-26 17:34:07 -07:00
cascode _ 1fbe2d6911 add automated format check 2023-10-26 17:34:07 -07:00
5 changed files with 53 additions and 57 deletions

View File

@ -0,0 +1,44 @@
name: checks
on:
pull_request:
paths: &CODE_PATHS
- 'src/**'
- 'Cargo*'
push:
paths: *CODE_PATHS
branches:
- main
jobs:
# TODO(cascode) cache checkout for build and test stages?
lint:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:0"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: rustfmt
run: cargo fmt --check
build:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:2"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: build
run: cargo build
# TODO(cascode) cache builds for test stage
test:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:2"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: run unit tests
run: cargo test

View File

@ -467,7 +467,7 @@ struct Purchase {
id: String,
items: Vec<LineItem>,
state: PurchaseState,
purchased_by: Option<Person>,
purchased_by: Person,
purchased_at: Option<chrono::DateTime>,
fulfilled_by: Option<Person>,
fulfilled_at: Option<chrono::DateTime>,

View File

@ -909,58 +909,4 @@ CREATE TABLE CouponCodeSkus (
CONSTRAINT CouponCodeSkus_FK FOREIGN KEY (coupon_code_id) REFERENCES CouponCodes(id),
CONSTRAINT CouponCodeSkus_FK_1 FOREIGN KEY (sku_id) REFERENCES Skus(id)
);
```
# Purchases
The Purchases table will contain Purchases!
``` sql
CREATE TABLE Purchases (
id TEXT(36),
state TEXT,
purchased_by TEXT(36),
purchased_at INTEGER,
fulfilled_by TEXT(36),
fulfilled_at INTEGER,
total_charge NUMERIC DEFAULT (0.00),
CONSTRAINT Purchases_PK PRIMARY KEY (id),
CONSTRAINT Purchases_FK FOREIGN KEY (purchased_by) REFERENCES Persons(id),
CONSTRAINT Purchases_FK_1 FOREIGN KEY (fulfilled_by) REFERENCES Persons(id)
);
CREATE INDEX Purchases_state_IDX ON Purchases (state);
CREATE INDEX Purchases_purchased_by_IDX ON Purchases (purchased_by);
CREATE INDEX Purchases_purchased_at_IDX ON Purchases (purchased_at);
CREATE INDEX Purchases_fulfilled_by_IDX ON Purchases (fulfilled_by);
CREATE INDEX Purchases_fulfilled_at_IDX ON Purchases (fulfilled_at);
CREATE INDEX Purchases_total_charge_IDX ON Purchases (total_charge);
```
# PurchaseLineItems
The PurchaseLineItems table will relate a Purchase to one or more LineItems.
``` sql
CREATE TABLE PurchaseLineItems (
purchase_id TEXT(36),
line_item_id TEXT(36),
CONSTRAINT PurchaseLineItems_PK PRIMARY KEY (purchase_id,line_item_id),
CONSTRAINT PurchaseLineItems_FK FOREIGN KEY (purchase_id) REFERENCES Purchases(id),
CONSTRAINT PurchaseLineItems_FK_1 FOREIGN KEY (line_item_id) REFERENCES LineItems(id) ON DELETE CASCADE
);
CREATE INDEX PurchaseLineItems_purchase_id_IDX ON PurchaseLineItems (purchase_id);
CREATE INDEX PurchaseLineItems_line_item_id_IDX ON PurchaseLineItems (line_item_id);
```
# PurchaseCouponCodes
The PurchaseCouponCodes table will relate a Purchase to one or more CouponCodes that were successfully applied to the Purchase.
``` sql
CREATE TABLE PurchaseCouponCodes (
purchase_id TEXT(36),
coupon_code_id TEXT(36),
CONSTRAINT PurchaseCouponCodes_PK PRIMARY KEY (purchase_id,coupon_code_id),
CONSTRAINT PurchaseCouponCodes_FK FOREIGN KEY (purchase_id) REFERENCES Purchases(id),
CONSTRAINT PurchaseCouponCodes_FK_1 FOREIGN KEY (coupon_code_id) REFERENCES CouponCodes(id)
);
CREATE INDEX PurchaseCouponCodes_purchase_id_IDX ON PurchaseCouponCodes (purchase_id);
CREATE INDEX PurchaseCouponCodes_coupon_code_id_IDX ON PurchaseCouponCodes (coupon_code_id);
```

7
ci/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM rust:1.73-alpine3.18
#install build tooling
RUN apk add musl-dev && rustup component add rustfmt
# install gitea act_runner dependencies
RUN apk add nodejs git

View File

@ -2,8 +2,7 @@ use warp::Filter;
#[tokio::main]
async fn main() {
let hello = warp::get()
.map(|| format!("Hello world!"));
let hello = warp::get().map(|| format!("Hello world!"));
warp::serve(hello).run(([127, 0, 0, 1], 5309)).await;
}