Implement Missing Features #89
Workflow file for this run
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
name: Pull Request checks | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15.3 | |
env: | |
POSTGRES_USER: devbox | |
POSTGRES_PASSWORD: pass | |
POSTGRES_HOST_AUTH_METHOD: trust | |
POSTGRES_DB: devbox | |
ports: | |
- "5432:5432" | |
volumes: | |
# - ${{ github.workspace }}/temp/db.sh:/home/db.sh | |
# - ${{ github.workspace }}/temp/schema.sql:/home/schema.sql | |
- ${{ github.workspace }}/temp:/home | |
options: --name postgres | |
steps: | |
- name: Git clone | |
run: | | |
sudo chown -R $USER:$USER /home/runner/work/skeleton | |
- name: Git clone | |
uses: actions/checkout@v4 | |
with: | |
clean: 'false' | |
ref: ${{ github.event.pull_request.head.sha }} # Checkout Pull Request HEAD commit instead of the default Pull Request merge commit. | |
fetch-depth: 1 | |
- name: Copy schema and db | |
run: | | |
mkdir -p temp | |
cp ./scripts/backend/db.sh ./temp/db.sh | |
cp ./db/schema.sql ./temp/schema.sql | |
- name: Restart postgres | |
uses: docker://docker | |
with: | |
args: docker restart postgres | |
- name: Git safe.directory | |
# Fixes following git error: | |
# error obtaining VCS status: exit status 128 | |
# Use -buildvcs=false to disable VCS stamping. (typecheck) | |
run: git config --global --add safe.directory '*' | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Run go tests | |
run: | | |
cp ./etc/ci.toml ./etc/test.toml | |
# go install github.com/mfridman/tparse@latest | |
set -o pipefail && DIR=$PWD go test -parallel 1 ./... -json # | tparse -all | |
- name: Static analysis check | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ghcr.io/golang-cz/static-analysis:v23.10.15-a16f233 | |
options: -v ${{ github.workspace }}:/src -w /src | |
run: golangci-lint run -c ./.golangci.yml ./... | |
- name: Check for big files | |
run: | | |
if [[ $(git ls-files | xargs du -hs --threshold=2M 2>/dev/null | tee /dev/stderr | wc -l) -gt 0 ]]; then | |
echo "Aborting due to big files in the git repository." | |
exit 1; | |
f/db.shi |