Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
44788877
Unverified
Commit
44788877
authored
7 months ago
by
Guilherme Gazzo
Committed by
GitHub
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ci: fix external pull requests (#33063)
parent
ec0cec69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/actions/build-docker/action.yml
+23
-3
23 additions, 3 deletions
.github/actions/build-docker/action.yml
.github/workflows/ci-test-e2e.yml
+7
-8
7 additions, 8 deletions
.github/workflows/ci-test-e2e.yml
with
30 additions
and
11 deletions
.github/actions/build-docker/action.yml
+
23
−
3
View file @
44788877
...
@@ -17,13 +17,25 @@ inputs:
...
@@ -17,13 +17,25 @@ inputs:
required
:
false
required
:
false
description
:
'
Containers
to
build
along
with
Rocket.Chat'
description
:
'
Containers
to
build
along
with
Rocket.Chat'
type
:
string
type
:
string
turbo-cache
:
required
:
false
description
:
'
Enable
turbo
cache'
default
:
'
true'
publish-image
:
required
:
false
description
:
'
Publish
image'
default
:
'
true'
setup
:
required
:
false
description
:
'
Setup
node.js'
default
:
'
true'
runs
:
runs
:
using
:
composite
using
:
composite
steps
:
steps
:
-
name
:
Login to GitHub Container Registry
-
name
:
Login to GitHub Container Registry
if
:
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
if
:
inputs.publish-image == 'true' &&
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
uses
:
docker/login-action@v2
uses
:
docker/login-action@v2
with
:
with
:
registry
:
ghcr.io
registry
:
ghcr.io
...
@@ -42,17 +54,20 @@ runs:
...
@@ -42,17 +54,20 @@ runs:
cd /tmp/build
cd /tmp/build
tar xzf Rocket.Chat.tar.gz
tar xzf Rocket.Chat.tar.gz
rm Rocket.Chat.tar.gz
rm Rocket.Chat.tar.gz
-
uses
:
rharkor/caching-for-turbo@v1.5
-
uses
:
rharkor/caching-for-turbo@v1.5
# if we are testing a PR from a fork, we already called the turbo cache at this point, so it should be false
if
:
inputs.turbo-cache == 'true'
-
name
:
Setup NodeJS
-
name
:
Setup NodeJS
uses
:
./.github/actions/setup-node
uses
:
./.github/actions/setup-node
if
:
inputs.setup == 'true'
with
:
with
:
node-version
:
${{ inputs.node-version }}
node-version
:
${{ inputs.node-version }}
cache-modules
:
true
cache-modules
:
true
install
:
true
install
:
true
-
run
:
yarn build
-
run
:
yarn build
if
:
inputs.setup == 'true'
shell
:
bash
shell
:
bash
-
name
:
Build Docker images
-
name
:
Build Docker images
...
@@ -63,9 +78,14 @@ runs:
...
@@ -63,9 +78,14 @@ runs:
docker compose -f docker-compose-ci.yml build "${args[@]}"
docker compose -f docker-compose-ci.yml build "${args[@]}"
-
name
:
Publish Docker images to GitHub Container Registry
-
name
:
Publish Docker images to GitHub Container Registry
if
:
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
if
:
inputs.publish-image == 'true' &&
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
shell
:
bash
shell
:
bash
run
:
|
run
:
|
args=(rocketchat ${{ inputs.build-containers }})
args=(rocketchat ${{ inputs.build-containers }})
docker compose -f docker-compose-ci.yml push "${args[@]}"
docker compose -f docker-compose-ci.yml push "${args[@]}"
-
name
:
Clean up temporary files
shell
:
bash
run
:
|
sudo rm -rf /tmp/bundle
This diff is collapsed.
Click to expand it.
.github/workflows/ci-test-e2e.yml
+
7
−
8
View file @
44788877
...
@@ -130,7 +130,9 @@ jobs:
...
@@ -130,7 +130,9 @@ jobs:
node-version
:
${{ inputs.node-version }}
node-version
:
${{ inputs.node-version }}
cache-modules
:
true
cache-modules
:
true
install
:
true
install
:
true
-
uses
:
rharkor/caching-for-turbo@v1.5
-
run
:
yarn build
# if we are testing a PR from a fork, we need to build the docker image at this point
# if we are testing a PR from a fork, we need to build the docker image at this point
-
uses
:
./.github/actions/build-docker
-
uses
:
./.github/actions/build-docker
if
:
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
if
:
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
...
@@ -138,8 +140,11 @@ jobs:
...
@@ -138,8 +140,11 @@ jobs:
CR_USER
:
${{ secrets.CR_USER }}
CR_USER
:
${{ secrets.CR_USER }}
CR_PAT
:
${{ secrets.CR_PAT }}
CR_PAT
:
${{ secrets.CR_PAT }}
node-version
:
${{ inputs.node-version }}
node-version
:
${{ inputs.node-version }}
# we already called the turbo cache at this point, so it should be false
-
uses
:
rharkor/caching-for-turbo@v1.5
turbo-cache
:
false
# the same reason we need to rebuild the docker image at this point is the reason we dont want to publish it
publish-image
:
false
setup
:
false
-
name
:
Start httpbin container and wait for it to be ready
-
name
:
Start httpbin container and wait for it to be ready
if
:
inputs.type == 'api'
if
:
inputs.type == 'api'
...
@@ -159,8 +164,6 @@ jobs:
...
@@ -159,8 +164,6 @@ jobs:
exit 1
exit 1
fi
fi
-
run
:
yarn build
-
name
:
Prepare code coverage directory
-
name
:
Prepare code coverage directory
if
:
inputs.release == 'ee'
if
:
inputs.release == 'ee'
run
:
|
run
:
|
...
@@ -187,10 +190,6 @@ jobs:
...
@@ -187,10 +190,6 @@ jobs:
run
:
|
run
:
|
docker compose -f docker-compose-ci.yml up -d
docker compose -f docker-compose-ci.yml up -d
-
name
:
Clean up temporary files
run
:
|
sudo rm -rf /tmp/bundle
-
name
:
Cache Playwright binaries
-
name
:
Cache Playwright binaries
if
:
inputs.type == 'ui'
if
:
inputs.type == 'ui'
uses
:
actions/cache@v3
uses
:
actions/cache@v3
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment