Skip to content

Commit 6a9d78a

Browse files
authored
Migrate from CircleCI to GitHub Actions (#5654)
2 parents 5cd89ed + 051e627 commit 6a9d78a

File tree

12 files changed

+219
-251
lines changed

12 files changed

+219
-251
lines changed

.circleci/config.yml

Lines changed: 0 additions & 132 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Setup Node.js and Install Dependencies'
2+
description: 'Setup Node.js with caching and install dependencies'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Setup Node.js
7+
uses: actions/setup-node@v6
8+
with:
9+
node-version: '22.14'
10+
cache: 'yarn'
11+
12+
- name: Install dependencies
13+
shell: bash
14+
run: yarn install --frozen-lockfile

.github/workflows/ci.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v5
17+
18+
- name: Setup Node.js and install dependencies
19+
uses: ./.github/actions/setup-node-and-install
20+
21+
- name: Run lint
22+
run: yarn lint
23+
24+
tests:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
30+
- name: Setup Node.js and install dependencies
31+
uses: ./.github/actions/setup-node-and-install
32+
33+
- name: Run tests
34+
# We use workerIdleMemoryLimit to work around a memory issue with node.
35+
# See https://github.com/facebook/jest/issues/11956
36+
run: yarn test --coverage --logHeapUsage -w=4 --workerIdleMemoryLimit=1.5G
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
fail_ci_if_error: false
42+
43+
build-prod:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v5
48+
49+
- name: Setup Node.js and install dependencies
50+
uses: ./.github/actions/setup-node-and-install
51+
52+
- name: Build production
53+
run: yarn build-prod:quiet
54+
55+
- name: Build symbolicator CLI
56+
run: yarn build-symbolicator-cli:quiet
57+
58+
licence-check:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v5
63+
64+
- name: Setup Node.js and install dependencies
65+
uses: ./.github/actions/setup-node-and-install
66+
67+
- name: Run license check
68+
run: yarn license-check
69+
70+
typecheck:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v5
75+
76+
- name: Setup Node.js and install dependencies
77+
uses: ./.github/actions/setup-node-and-install
78+
79+
- name: Run TypeScript check
80+
run: yarn ts
81+
82+
alex:
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Checkout code
86+
uses: actions/checkout@v5
87+
88+
- name: Setup Node.js and install dependencies
89+
uses: ./.github/actions/setup-node-and-install
90+
91+
- name: Run alex
92+
run: yarn test-alex
93+
94+
yarn-lock:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v5
99+
100+
- name: Setup Node.js and install dependencies
101+
uses: ./.github/actions/setup-node-and-install
102+
103+
- name: Check yarn.lock
104+
run: yarn test-lockfile
105+
106+
shellcheck:
107+
runs-on: ubuntu-latest
108+
steps:
109+
- name: Checkout code
110+
uses: actions/checkout@v5
111+
112+
- name: Run ShellCheck
113+
uses: ludeeus/action-shellcheck@master
114+
with:
115+
scandir: './bin'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
paths:
55
- 'locales/en-US/*.ftl'
6-
- '.github/workflows/fluent_linter.yml'
6+
- '.github/workflows/fluent-linter.yml'
77
- '.github/fluent/*'
88
branches:
99
- main
@@ -32,4 +32,4 @@ jobs:
3232
pip install -r .github/fluent/requirements.txt
3333
- name: Lint reference
3434
run: |
35-
moz-fluent-lint ./locales/en-US --config .github/fluent/linter_config.yml
35+
moz-fluent-lint ./locales/en-US --config .github/fluent/linter-config.yml

.github/workflows/l10n-sync.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: L10n Sync
2+
3+
on:
4+
schedule:
5+
# Runs at 8 AM UTC every day
6+
- cron: '0 8 * * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Setup Node.js and install dependencies
17+
uses: ./.github/actions/setup-node-and-install
18+
19+
- name: Run tests
20+
run: yarn test --logHeapUsage -w=4
21+
22+
l10n-sync:
23+
runs-on: ubuntu-latest
24+
needs: tests
25+
if: github.ref == 'refs/heads/main'
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
with:
30+
ssh-key: ${{ secrets.L10N_SYNC_SSH_KEY }}
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: '22.14'
36+
cache: 'yarn'
37+
38+
- name: Configure git
39+
run: |
40+
git config user.email "[email protected]"
41+
git config user.name "Firefox Profiler [bot]"
42+
43+
- name: Run l10n sync
44+
run: node ./bin/l10n-sync.js -y

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ When working on a new feature and code changes, it's important that things work
9191
- We have [husky](https://www.npmjs.com/package/husky) installed to run automated checks when committing and pushing.
9292
- Run git commands with `--no-verify` to skip this step. This is useful for submitting broken PRs for feedback.
9393
- Continuous integration for pull requests
94-
- We use CircleCI to run our tests for every PR that is submitted. This gives reviewers a great way to know if things are still working as expected.
94+
- We use GitHub Actions to run our tests for every PR that is submitted. This gives reviewers a great way to know if things are still working as expected.
9595

9696
### Updating snapshots
9797

bin/l10n-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function logAndPipeExec(...commands /*: string[][] */) /*: string */ {
8989
/**
9090
* Pause with a message and wait for the enter as a confirmation.
9191
* The prompt will not be displayed if the `-y` argument is given to the script.
92-
* This is mainly used by the CircleCI automation.
92+
* This is mainly used by the GitHub Actions automation.
9393
*/
9494
async function pauseWithMessageIfNecessary(
9595
message /*: string */ = ''

bin/pre-install.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,18 @@ function checkYarn(agents /*: AgentsVersion */) {
9898
}
9999

100100
function parseExpectedNodeVersion() {
101-
// Let's fetch our minimal version from circleci's file
101+
// Let's fetch our minimal version from GitHub Actions composite action file
102102
const fs = require('fs');
103-
const circleConfig = fs.readFileSync('.circleci/config.yml', {
104-
encoding: 'utf8',
105-
});
106-
const expectedNodeVersion = /image: cimg\/node:([\d.]+)/.exec(circleConfig);
103+
const actionConfig = fs.readFileSync(
104+
'.github/actions/setup-node-and-install/action.yml',
105+
{
106+
encoding: 'utf8',
107+
}
108+
);
109+
const expectedNodeVersion = /node-version:\s*'([\d.]+)'/.exec(actionConfig);
107110
if (!expectedNodeVersion) {
108111
throw new Error(
109-
`Couldn't extract the node version from .circleci/config.yml.`
112+
`Couldn't extract the node version from .github/actions/setup-node-and-install/action.yml.`
110113
);
111114
}
112115
return expectedNodeVersion[1];

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
"browserslist": "^4.27.0",
141141
"caniuse-lite": "^1.0.30001751",
142142
"circular-dependency-plugin": "^5.2.1",
143-
"codecov": "^3.8.3",
144143
"copy-webpack-plugin": "^13.0.1",
145144
"cross-env": "^10.1.0",
146145
"css-loader": "^7.1.2",

0 commit comments

Comments
 (0)