-
-
Notifications
You must be signed in to change notification settings - Fork 1
wip e2e #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wip e2e #3
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,22 @@ | ||
| ARG composer=latest | ||
| ARG php=8 | ||
|
|
||
| FROM composer:${composer} AS composer-bin | ||
|
|
||
| FROM php:${php}-cli-alpine | ||
|
|
||
| ENV PATH="/usr/local/go/bin:$PATH" | ||
| ENV GOROOT=/usr/local/go | ||
| ENV GOTOOLCHAIN=local | ||
| ENV GOFLAGS=-mod=mod | ||
|
|
||
| COPY --from=composer-bin --link /usr/bin/composer /usr/bin/composer | ||
| COPY --from=golang:1-alpine --link /usr/local/go /usr/local/go | ||
|
|
||
| COPY go.mod go.sum /tmp-app/ | ||
| WORKDIR /tmp-app | ||
| RUN go mod download && rm -rf /tmp-app | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| CMD ["go", "test", "./..."] |
This file contains hidden or 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,37 @@ | ||
| export GOFLAGS=-mod=mod | ||
|
|
||
| combos := php-8-composer-latest \ | ||
| php-8.4-composer-2.8 \ | ||
| php-8.4-composer-2.7 \ | ||
| php-8.4-composer-2.6 | ||
|
|
||
| buildflags ?= --quiet | ||
|
|
||
| define GEN_RULE | ||
| build-php-$(1)-composer-$(2): | ||
| docker build $(buildflags) --build-arg php=$(1) --build-arg composer=$(2) --tag wp-org-closed-plugin:php-$(1)-composer-$(2) . | ||
|
|
||
| test-php-$(1)-composer-$(2): build-php-$(1)-composer-$(2) | ||
| docker run --volume $(shell pwd):/app --rm wp-org-closed-plugin:php-$(1)-composer-$(2) $(testcmd) | ||
| endef | ||
|
|
||
| $(foreach combo,$(combos), $(eval $(call GEN_RULE,$(word 2,$(subst -, ,$(combo))),$(word 4,$(subst -, ,$(combo)))))) | ||
|
|
||
| test: $(foreach c,$(combos), test-$(c)) | ||
|
|
||
| build-latest: build-php-8-composer-latest | ||
| test-latest: test-php-8-composer-latest | ||
|
|
||
| test-local: | ||
| go test ./... | ||
|
|
||
| update-scripts: | ||
| UPDATE_SCRIPTS=1 $(MAKE) test-local | ||
|
|
||
| clean: | ||
| @IMAGE_IDS="$(shell docker images -q wp-org-closed-plugin)"; \ | ||
| if test -z "$${IMAGE_IDS}"; then \ | ||
| echo "Skip: No wp-org-closed-plugin images found."; \ | ||
| else \ | ||
| docker rmi $${IMAGE_IDS}; \ | ||
| fi |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,71 +1,71 @@ | ||
| { | ||
| "name": "typisttech/wp-org-closed-plugin", | ||
| "description": "TODO", | ||
| "license": "MIT", | ||
| "type": "composer-plugin", | ||
| "keywords": [ | ||
| "TODO" | ||
| ], | ||
| "authors": [ | ||
| { | ||
| "name": "Typist Tech", | ||
| "homepage": "https://typist.tech" | ||
| "name": "typisttech/wp-org-closed-plugin", | ||
| "description": "TODO", | ||
| "license": "MIT", | ||
| "type": "composer-plugin", | ||
| "keywords": [ | ||
| "TODO" | ||
| ], | ||
| "authors": [ | ||
| { | ||
| "name": "Typist Tech", | ||
| "homepage": "https://typist.tech" | ||
| }, | ||
| { | ||
| "name": "Tang Rufus", | ||
| "email": "[email protected]", | ||
| "homepage": "https://tangrufus.com", | ||
| "role": "Developer" | ||
| } | ||
| ], | ||
| "homepage": "https://github.com/typisttech/wp-org-closed-plugin", | ||
| "support": { | ||
| "issues": "https://github.com/typisttech/wp-org-closed-plugin/issues", | ||
| "source": "https://github.com/typisttech/wp-org-closed-plugin", | ||
| "security": "https://github.com/typisttech/wp-org-closed-plugin/security" | ||
| }, | ||
| { | ||
| "name": "Tang Rufus", | ||
| "email": "[email protected]", | ||
| "homepage": "https://tangrufus.com", | ||
| "role": "Developer" | ||
| } | ||
| ], | ||
| "homepage": "https://github.com/typisttech/wp-org-closed-plugin", | ||
| "support": { | ||
| "issues": "https://github.com/typisttech/wp-org-closed-plugin/issues", | ||
| "source": "https://github.com/typisttech/wp-org-closed-plugin", | ||
| "security": "https://github.com/typisttech/wp-org-closed-plugin/security" | ||
| }, | ||
| "require": { | ||
| "php": "^8.4", | ||
| "composer-plugin-api": "^2.6" | ||
| }, | ||
| "require-dev": { | ||
| "composer/composer": "^2.8", | ||
| "pestphp/pest": "^4.1", | ||
| "phpstan/extension-installer": "^1.4", | ||
| "phpstan/phpstan": "^2.1", | ||
| "phpstan/phpstan-deprecation-rules": "^2.0", | ||
| "phpstan/phpstan-strict-rules": "^2.0" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "TypistTech\\WpOrgClosedPlugin\\": "src/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "config": { | ||
| "allow-plugins": { | ||
| "pestphp/pest-plugin": true, | ||
| "phpstan/extension-installer": true | ||
| "require": { | ||
| "php": "^8.4", | ||
| "composer-plugin-api": "^2.6" | ||
| }, | ||
| "sort-packages": true | ||
| }, | ||
| "extra": { | ||
| "class": "TypistTech\\WpOrgClosedPlugin\\Main", | ||
| "plugin-modifies-downloads": true, | ||
| "plugin-optional": true | ||
| }, | ||
| "scripts": { | ||
| "lint": [ | ||
| "@composer normalize --dry-run", | ||
| "pint --test", | ||
| "phpstan analyse" | ||
| ], | ||
| "pest": "pest", | ||
| "pest:feature": "pest --group=feature", | ||
| "pest:unit": "pest --group=unit" | ||
| } | ||
| "require-dev": { | ||
| "composer/composer": "^2.8", | ||
| "pestphp/pest": "^4.1", | ||
| "phpstan/extension-installer": "^1.4", | ||
| "phpstan/phpstan": "^2.1", | ||
| "phpstan/phpstan-deprecation-rules": "^2.0", | ||
| "phpstan/phpstan-strict-rules": "^2.0" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "TypistTech\\WpOrgClosedPlugin\\": "src/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "config": { | ||
| "allow-plugins": { | ||
| "pestphp/pest-plugin": true, | ||
| "phpstan/extension-installer": true | ||
| }, | ||
| "sort-packages": true | ||
| }, | ||
| "extra": { | ||
| "class": "TypistTech\\WpOrgClosedPlugin\\Main", | ||
| "plugin-modifies-downloads": true, | ||
| "plugin-optional": true | ||
| }, | ||
| "scripts": { | ||
| "lint": [ | ||
| "@composer normalize --dry-run", | ||
| "pint --test", | ||
| "phpstan analyse" | ||
| ], | ||
| "pest": "pest", | ||
| "pest:feature": "pest --group=feature", | ||
| "pest:unit": "pest --group=unit" | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,10 @@ | ||
| module github.com/typisttech/wp-org-closed-plugin | ||
|
|
||
| go 1.25.3 | ||
|
|
||
| require github.com/rogpeppe/go-internal v1.14.1 | ||
|
|
||
| require ( | ||
| golang.org/x/sys v0.26.0 // indirect | ||
| golang.org/x/tools v0.26.0 // indirect | ||
| ) |
This file contains hidden or 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,6 @@ | ||
| github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= | ||
| github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= | ||
| golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= | ||
| golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||
| golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= | ||
| golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= |
This file contains hidden or 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,24 @@ | ||
| package main_test | ||
|
|
||
| import ( | ||
| "os" | ||
| "testing" | ||
|
|
||
| "github.com/rogpeppe/go-internal/testscript" | ||
| ) | ||
|
|
||
| func Test(t *testing.T) { | ||
| testscript.Run(t, testscript.Params{ | ||
| Dir: "testdata/script", | ||
| Setup: func(env *testscript.Env) error { | ||
| wd, err := os.Getwd() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| env.Setenv("PWD", wd) | ||
| env.Setenv("COMPOSER_CACHE_DIR", "/dev/null") | ||
| return nil | ||
| }, | ||
| UpdateScripts: os.Getenv("UPDATE_SCRIPTS") == "1", | ||
| }) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium test