diff --git a/.dagger/main.go b/.dagger/main.go index d63bd62..2a338a0 100644 --- a/.dagger/main.go +++ b/.dagger/main.go @@ -40,12 +40,14 @@ func (p *PipelineDagger) Build( return p.Frontend.Build() } +// Only run the tests func (p *PipelineDagger) RunTests( ctx context.Context, ) (string, error) { return p.Frontend.UnitTest(ctx) } +// Run the tests with debug no push comment to github func (p *PipelineDagger) RunTestsWithDebug( ctx context.Context, // The model to use to debug debug tests diff --git a/.github/workflows/1_wf_build.yaml b/.github/workflows/1_wf_build.yaml index 96d56a2..3d0b257 100644 --- a/.github/workflows/1_wf_build.yaml +++ b/.github/workflows/1_wf_build.yaml @@ -1,3 +1,7 @@ +# Run test locally with act +# act --secret-file my.secrets --var-file my.variables -W ".github/workflows/1_wf_build.yaml" -p=false +# -p=false to avoid unnecessary image pulls +# link act on wsl windows unbuntu: (user root) cd ~/.config/act/ name: wf_fe_build on: diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f71d107 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +# make check WORKFLOW_FILE="aaa.yaml" + +SECRET_FILE := my.secrets +VARIABLES_FILE := my.variables +WORKFLOW_FILE := 1_wf_build.yaml + +check: + act --secret-file $(SECRET_FILE) --var-file $(VARIABLES_FILE) -W ".github/workflows/$(WORKFLOW_FILE)" -p=false + +.PHONY: check diff --git a/my.secrets b/my.secrets new file mode 100644 index 0000000..38e5444 --- /dev/null +++ b/my.secrets @@ -0,0 +1 @@ +DOCKER_PASSWORD="quangduytran0905161395" diff --git a/my.variables b/my.variables new file mode 100644 index 0000000..af566b0 --- /dev/null +++ b/my.variables @@ -0,0 +1,3 @@ +DOCKER_URL="docker.io" +DOCKER_USERNAME="onlylight291998" +ENVVAR_WEBSITE="PORT=3100 REACT_APP_API_URL=http://localhost:3000" \ No newline at end of file