Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
9e7107ea
Verified
Commit
9e7107ea
authored
9 months ago
by
Beatriz Rizental
Committed by
Pier Angelo Vendrame
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fixup! Add CI for Base Browser
Use tb-build dedicated runners for lint CI.
parent
540fbb61
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-2
1 addition, 2 deletions
.gitlab-ci.yml
.gitlab/ci/lint.yml
+24
-33
24 additions, 33 deletions
.gitlab/ci/lint.yml
.gitlab/ci/setup.yml
+0
-56
0 additions, 56 deletions
.gitlab/ci/setup.yml
with
25 additions
and
91 deletions
.gitlab-ci.yml
+
1
−
2
View file @
9e7107ea
stages
:
-
setup
-
lint
variables
:
IMAGE_PATH
:
containers.torproject.org/tpo/applications/tor-browser/base:latest
LOCAL_REPO_PATH
:
/srv/apps-repos/${CI_PROJECT_NAME}.git
include
:
-
local
:
'
.gitlab/ci/setup.yml'
-
local
:
'
.gitlab/ci/lint.yml'
This diff is collapsed.
Click to expand it.
.gitlab/ci/lint.yml
+
24
−
33
View file @
9e7107ea
...
...
@@ -2,13 +2,9 @@
stage
:
lint
image
:
$IMAGE_PATH
interruptible
:
true
needs
:
-
job
:
setup-env
artifacts
:
true
-
job
:
create-bundle
artifacts
:
true
variables
:
MOZBUILD_STATE_PATH
:
"
$CI_PROJECT_DIR/.cache/mozbuild"
# A copy of the repository already is available in the runner.
GIT_STRATEGY
:
"
none"
cache
:
paths
:
...
...
@@ -18,26 +14,21 @@
when
:
'
always'
# Share the cache throughout all pipelines running for a given branch
key
:
$CI_COMMIT_REF_SLUG
tags
:
# Run these jobs in the browser dedicated runners.
-
firefox
before_script
:
# DEBUG: Are all artifacts here?
-
ls -a
-
mkdir app && cd app
# Initialize a fresh git repo
-
git init
# Add app.bundle as the remote. All operations that communicate with the remote will be local.
-
git remote add origin ../app.bundle
# shallow.txt contains the SHA of the base commit of the bundle.
# The bundle is shallow, therefore it's base commit will not have a parent.
# Adding the SHA of the base commit to .git/shallow tells git that it doesn't need
# to crash when it realizes said base commit doesn't have a parent.
-
cp ../shallow.txt .git/shallow
# Finally, unpack the bundle. Time it for debugging purposes.
-
time git pull origin $BRANCH_NAME
-
git remote add local "$LOCAL_REPO_PATH"
-
git fetch --depth 500 local
-
git remote add origin "$CI_REPOSITORY_URL"
-
git fetch origin ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
-
git checkout ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
eslint
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l eslint
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l eslint
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -66,7 +57,7 @@ eslint:
stylelint
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l stylelint
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l stylelint
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -84,7 +75,7 @@ stylelint:
py-black
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l black
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l black
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -103,7 +94,7 @@ py-black:
py-ruff
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l ruff
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l ruff
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -122,7 +113,7 @@ py-ruff:
yaml
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l yaml
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l yaml
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -137,7 +128,7 @@ yaml:
shellcheck
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l shellcheck
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l shellcheck
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -152,7 +143,7 @@ clang-format:
extends
:
.base
script
:
-
./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l clang-format
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l clang-format
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -171,7 +162,7 @@ clang-format:
rustfmt
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l rustfmt
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l rustfmt
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -185,7 +176,7 @@ rustfmt:
fluent-lint
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l fluent-lint
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l fluent-lint
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -200,7 +191,7 @@ fluent-lint:
localization
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l l10n
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l l10n
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -217,7 +208,7 @@ localization:
mingw-capitalization
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l mingw-capitalization
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l mingw-capitalization
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -234,7 +225,7 @@ mingw-capitalization:
mscom-init
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l mscom-init
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l mscom-init
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -251,7 +242,7 @@ mscom-init:
file-whitespace
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l file-whitespace
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l file-whitespace
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -280,7 +271,7 @@ file-whitespace:
test-manifest
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
@@ -295,7 +286,7 @@ test-manifest:
trojan-source
:
extends
:
.base
script
:
-
cat ../
changedfiles
.txt
| xargs -d '\n' ./mach lint -l trojan-source
-
.gitlab/ci/scripts/helpers.py --get-
changed
-
files | xargs -d '\n' ./mach lint -l trojan-source
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event'
changes
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab/ci/setup.yml
deleted
100644 → 0
+
0
−
56
View file @
540fbb61
setup-env
:
stage
:
setup
interruptible
:
true
variables
:
GIT_STRATEGY
:
"
none"
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_REF_PROTECTED == 'true'
script
:
-
|
if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
echo "BRANCH_NAME=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" > build.env
else
echo "BRANCH_NAME=$CI_COMMIT_REF_NAME" > build.env
fi
artifacts
:
reports
:
dotenv
:
-
build.env
create-bundle
:
stage
:
setup
# TODO: Find a better suited image, this one just has git.
image
:
python
needs
:
-
job
:
setup-env
artifacts
:
true
rules
:
-
if
:
$CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_REF_PROTECTED == 'true'
variables
:
GIT_DEPTH
:
"
1"
interruptible
:
true
script
:
# DEBUG: Check repository status.
-
git status
# DEBUG: Check branches in repository
-
git branch
# Force switch to a named branch. We force it in case there is already
# a branch with the same name from previous runs.
-
git switch -C $BRANCH_NAME
# Create a git bundle -- this will generate the app.bundle file,
# which can be used as a git remote for offline fetching.
-
git bundle create app.bundle $BRANCH_NAME
# Retain the SHA of the base of this shallow repository.
-
cat .git/shallow > shallow.txt
# DEBUG: Check sizes.
-
du -sh .git
-
du -sh app.bundle
# Since this is the only job we have access to the Gitlab remote,
# let's get a list of changed files to use in the next jobs.
-
.gitlab/ci/scripts/helpers.py --get-changed-files > changedfiles.txt
artifacts
:
paths
:
-
app.bundle
-
shallow.txt
-
changedfiles.txt
expire_in
:
1 hour
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