Compare commits

...
Author SHA1 Message Date
Susan Zhang 8003ecae4b Create close-stale-issues.yml 2024-04-09 13:07:09 -07:00
Susan Zhang a55f3d6117 Merge pull request #120 from actions/dependabot/github_actions/goreleaser/goreleaser-action-9937f9bad91e089c6c6fe1d43dfa7b896ad6da21
Bump goreleaser/goreleaser-action from c21f56a7bc891b5f73bec61233c4102ef8273150 to 9937f9bad91e089c6c6fe1d43dfa7b896ad6da21
2024-04-08 17:20:40 -07:00
dependabot[bot] 0b993e4035 Bump goreleaser/goreleaser-action
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from c21f56a7bc891b5f73bec61233c4102ef8273150 to 9937f9bad91e089c6c6fe1d43dfa7b896ad6da21.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/c21f56a7bc891b5f73bec61233c4102ef8273150...9937f9bad91e089c6c6fe1d43dfa7b896ad6da21)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-04-08 20:35:50 +00:00
Shawn Hartsell cd1939e72d Merge pull request #117 from actions/sh/fix-test-flake
Fix flakey E2E tests
2024-04-08 09:35:25 -05:00
Shawn Hartsell ea5bded901 refactoring test script to use ps instead of lsof when checking for git daemon 2024-04-05 13:03:43 -05:00
Shawn Hartsell 09d0eed117 checking that the git daemons are set up before running integration tests 2024-04-05 12:51:58 -05:00
Shawn Hartsell 23ff827d24 formatting test-build 2024-04-05 12:50:29 -05:00
3 changed files with 78 additions and 28 deletions
+22
View File
@@ -0,0 +1,22 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
- name: Set CURRENT_TAG
run: echo "GORELEASER_CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@c21f56a7bc891b5f73bec61233c4102ef8273150
uses: goreleaser/goreleaser-action@9937f9bad91e089c6c6fe1d43dfa7b896ad6da21
with:
version: latest
args: release --clean
+55 -27
View File
@@ -58,9 +58,9 @@ function test_push() {
# Push multiple branches
setup_cache "org/repo:heads/change:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org/repo:heads/nochange:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org/repo:heads/nochange:a5984bb887dd2fcdc2892cd906d6f004844d1142"
setup_dest "org/repo:heads/change:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org/repo:heads/nochange:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org/repo:heads/nochange:a5984bb887dd2fcdc2892cd906d6f004844d1142"
push "pushing multiple branches"
assert_dest_sha "org/repo" "heads/change" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/change to new commit"
@@ -68,9 +68,9 @@ function test_push() {
# Pushing multiple branches and tags
setup_cache "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org/repo:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
"org/repo:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org/repo:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org/repo:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142"
push "pushing multiple branches and tags"
assert_dest_sha "org/repo" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/main to new commit"
@@ -78,13 +78,13 @@ function test_push() {
# Pushing multiple repositories
setup_cache "org1/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org1/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org1/repo2:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org2/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
"org1/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org1/repo2:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org2/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
setup_dest "org1/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org1/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org1/repo2:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org2/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org1/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org1/repo2:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org2/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
push "pushing multiple repositories"
assert_dest_sha "org1/repo1" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo1:heads/main to new commit"
@@ -94,9 +94,9 @@ function test_push() {
# Honor --repo-name flag, ignore other cache entries
setup_cache "org/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
"org/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
setup_dest "org/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
push2args --repo-name "org/repo1" "pushing only one of the repos in the cache"
assert_dest_sha "org/repo1" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo1 passed in repo flag"
@@ -191,9 +191,9 @@ function test_sync() {
# Honor --repo-name flag, ignore other cache entries
setup_cache "org/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
"org/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
"org/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
setup_dest "org/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
"org/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
"org/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
sync --repo-name "org/repo1" "syncing only one of the repos in the cache"
assert_dest_sha "org/repo1" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo1 passed in repo flag"
@@ -208,7 +208,7 @@ function before_suite() {
rm -rf test/tmp
mkdir -p test/tmp/dest
mkdir -p test/tmp/src
) > /dev/null
) >/dev/null
git daemon \
--reuseaddr \
@@ -216,7 +216,7 @@ function before_suite() {
--export-all \
--enable=receive-pack \
--port="$SRC_GIT_DAEMON_PORT" \
--base-path=test/tmp/src &> $SRC_GIT_DAEMON_OUTPUT &
--base-path=test/tmp/src &>$SRC_GIT_DAEMON_OUTPUT &
SRC_GIT_DAEMON_PID=$!
git daemon \
@@ -225,12 +225,24 @@ function before_suite() {
--export-all \
--enable=receive-pack \
--port="$DEST_GIT_DAEMON_PORT" \
--base-path=test/tmp/dest &> $DEST_GIT_DAEMON_OUTPUT &
--base-path=test/tmp/dest &>$DEST_GIT_DAEMON_OUTPUT &
DEST_GIT_DAEMON_PID=$!
# wait for the git daemons to start before continuing
if ! check_git_daemon $SRC_GIT_DAEMON_PORT; then
echo "timeout waiting for src git daemon to start"
exit 1
fi
if ! check_git_daemon $DEST_GIT_DAEMON_PORT; then
echo "timeout waiting for dest git daemon to start"
exit 1
fi
go run test/github.go \
-p "$DEST_API_PORT" \
-git-daemon-url "git://localhost:$DEST_GIT_DAEMON_PORT/" &> $DEST_API_OUTPUT &
-git-daemon-url "git://localhost:$DEST_GIT_DAEMON_PORT/" &>$DEST_API_OUTPUT &
DEST_API_PID=$!
script/build
@@ -257,7 +269,7 @@ function setup_src() {
local org=$(echo $nwo | cut -d'/' -f1)
mkdir -p test/tmp/src/$org && cp -R test/fixtures/repo.git test/tmp/src/$nwo
echo "$sha" > "test/tmp/src/$nwo/refs/$refname"
echo "$sha" >"test/tmp/src/$nwo/refs/$refname"
done
}
@@ -270,7 +282,7 @@ function setup_cache() {
local refname=$(echo $r | cut -d':' -f2)
local sha=$(echo $r | cut -d':' -f3)
mkdir -p test/tmp/cache/$nwo && cp -R test/fixtures/repo.git test/tmp/cache/$nwo/.git
echo "$sha" > "test/tmp/cache/$nwo/.git/refs/$refname"
echo "$sha" >"test/tmp/cache/$nwo/.git/refs/$refname"
done
}
@@ -283,13 +295,13 @@ function setup_dest() {
local refname=$(echo $r | cut -d':' -f2)
local sha=$(echo $r | cut -d':' -f3)
mkdir -p test/tmp/dest/$nwo && cp -R test/fixtures/repo.git test/tmp/dest/$nwo/.git
echo "$sha" > "test/tmp/dest/$nwo/.git/refs/$refname"
echo "$sha" >"test/tmp/dest/$nwo/.git/refs/$refname"
done
}
function version() {
bin/actions-sync version \
&> $OUTPUT ||
&>$OUTPUT ||
fail $1
}
@@ -298,7 +310,7 @@ function pull() {
--cache-dir "test/tmp/cache" \
--source-url "git://localhost:$SRC_GIT_DAEMON_PORT" \
"$1" "$2" \
&> $OUTPUT ||
&>$OUTPUT ||
fail $3
}
@@ -308,7 +320,7 @@ function push() {
--disable-push-git-auth \
--destination-token "token" \
--destination-url "http://localhost:$DEST_API_PORT" \
&> $OUTPUT ||
&>$OUTPUT ||
fail "$1"
}
@@ -319,7 +331,7 @@ function push2args() {
--destination-token "token" \
--destination-url "http://localhost:$DEST_API_PORT" \
"$1" "$2" \
&> $OUTPUT ||
&>$OUTPUT ||
fail $3
}
@@ -330,7 +342,7 @@ function push_impersonation() {
--destination-token "token" \
--destination-url "http://localhost:$DEST_API_PORT" \
--actions-admin-user $1 \
&> $OUTPUT ||
&>$OUTPUT ||
fail "$2"
}
@@ -342,7 +354,7 @@ function sync() {
--destination-token "token" \
--destination-url "http://localhost:$DEST_API_PORT" \
"$1" "$2" \
&> $OUTPUT ||
&>$OUTPUT ||
fail $3
}
@@ -383,6 +395,22 @@ function fail() {
exit 1
}
function check_git_daemon {
port=$1
for i in {1..10}; do
process=$(ps aux | grep "git daemon" | grep $port)
if [ -z "$process" ]; then
echo "Waiting for git daemon to start on port $port..."
sleep 1
else
echo "Git daemon is running on port $port"
return 0
fi
done
echo "Git daemon did not start within the expected time."
return 1
}
test_version
before_suite
test_pull