Skip to content

Commit

Permalink
ci: pls work
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCMcCoy committed Jan 31, 2024
1 parent e38c157 commit 9bfc61b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI (Formatting, Testing, Building)
name: CI (Formatting/Linting, Testing, Building)

on:
push:
Expand Down Expand Up @@ -34,14 +34,34 @@ jobs:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Format
- name: Format Frontend
run: |
task build
cd client
npm run format
cd ../backend
go fmt
go vet
fe_format_output=$(npm run format)
if [[ -n "$fe_format_output" ]]; then
echo "$fe_format_output"
echo "::error::Formatting issues found"
exit 1
fi
- name: Format Backend
run: |
cd backend
be_format_output=$(go fmt ./...)
if [[ -n "$be_format_output" ]]; then
echo "$be_format_output"
echo "::error::Formatting issues found"
exit 1
fi
be_lint_output=$(go vet)
- name: Lint Backend
run: |
cd backend
be_lint_output=$(go vet ./...)
if [[ -n "$be_lint_output" ]]; then
echo "$be_lint_output"
echo "::error::Linting issues found"
exit 1
fi
test:
name: Test
Expand Down
2 changes: 1 addition & 1 deletion backend/schema/files/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ func (pg *PgModel) UploadFileRoute(c *gin.Context) {
}

c.JSON(http.StatusOK, file)
}
}
4 changes: 2 additions & 2 deletions backend/schema/files/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func UploadFile(pool *pgx.Conn, file models.File, data *multipart.FileHeader, re
fmt.Println(err.Error())
return err
}

uploader := s3manager.NewUploader(sess)
_, err = uploader.Upload(&s3manager.UploadInput{
Bucket: aws.String(AWS_BUCKET_NAME),
Expand All @@ -68,4 +68,4 @@ func UploadFile(pool *pgx.Conn, file models.File, data *multipart.FileHeader, re
}

return nil
}
}
6 changes: 3 additions & 3 deletions client/components/DocPickerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { View, Button, Text } from 'react-native';
import * as DocumentPicker from 'expo-document-picker';
import { uploadFile } from '../services/file';

export default function DocPickerButton(){
export default function DocPickerButton() {
const [pickedDocument, setPickedDocument] = useState<string | null>(null);

const pickDocument = async () => {
Expand All @@ -18,7 +18,7 @@ export default function DocPickerButton(){
// TODO get userID and groupID
const userID = 0;
const groupID = 0;
await uploadFile(result.assets[0], userID, groupID)
await uploadFile(result.assets[0], userID, groupID);
}
} catch (err) {
console.log('err', err);
Expand All @@ -31,4 +31,4 @@ export default function DocPickerButton(){
{pickedDocument && <Text>Picked Document: {pickedDocument}</Text>}
</View>
);
};
}
2 changes: 1 addition & 1 deletion client/types/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export interface File {
upload_date: string;
file_size: number;
task_id: number;
}
}

0 comments on commit 9bfc61b

Please sign in to comment.