summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-11-19 16:11:20 -0700
committerGitHub <noreply@github.com>2023-11-19 16:11:20 -0700
commit93c4c1a2c16f2db3051353d78989ffd29bf9e455 (patch)
tree3a2c504761d576a2aebddaa72bf74bfa7e3cd149
parentc806fbdabe144c865612bbbc9ef596c9611c8310 (diff)
chore: add aarch64-apple-darwin builds to ci (#21243)
This is a prerequisite to automatic code signing.
-rwxr-xr-x.github/workflows/ci.generate.ts90
-rw-r--r--.github/workflows/ci.yml157
-rw-r--r--tools/util.js17
3 files changed, 168 insertions, 96 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 666d0d3c1..be71828e3 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -7,18 +7,22 @@ import * as yaml from "https://deno.land/std@0.173.0/encoding/yaml.ts";
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 59;
-const Runners = (() => {
- const ubuntuRunner = "ubuntu-22.04";
- const ubuntuXlRunner = "ubuntu-22.04-xl";
- const windowsRunner = "windows-2022";
- const windowsXlRunner = "windows-2022-xl";
+const ubuntuRunner = "ubuntu-22.04";
+const ubuntuXlRunner = "ubuntu-22.04-xl";
+const windowsRunner = "windows-2022";
+const windowsXlRunner = "windows-2022-xl";
+const macosX86Runner = "macos-12";
+// https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/
+const macosArmRunner = "macos-13-xlarge";
+const Runners = (() => {
return {
ubuntuXl:
`\${{ github.repository == 'denoland/deno' && '${ubuntuXlRunner}' || '${ubuntuRunner}' }}`,
ubuntu: ubuntuRunner,
linux: ubuntuRunner,
- macos: "macos-12",
+ macos: macosX86Runner,
+ macosArm: macosArmRunner,
windows: windowsRunner,
windowsXl:
`\${{ github.repository == 'denoland/deno' && '${windowsXlRunner}' || '${windowsRunner}' }}`,
@@ -199,7 +203,7 @@ function skipJobsIfPrAndMarkedSkip(
return steps.map((s) =>
withCondition(
s,
- "!(github.event_name == 'pull_request' && matrix.skip_pr)",
+ "!(matrix.skip)",
)
);
}
@@ -235,6 +239,7 @@ function removeSurroundingExpression(text: string) {
function handleMatrixItems(items: {
skip_pr?: string | true;
+ skip?: string;
os: string;
profile?: string;
job?: string;
@@ -246,20 +251,32 @@ function handleMatrixItems(items: {
return "ubuntu-x86_64";
} else if (os.includes("windows")) {
return "windows-x86_64";
- } else if (os.includes("macos")) {
+ } else if (os == macosX86Runner) {
return "macos-x86_64";
+ } else if (os == macosArmRunner) {
+ return "macos-aarch64";
} else {
throw new Error(`Display name not found: ${os}`);
}
}
return items.map((item) => {
- // use a free "ubuntu" runner on jobs that are skipped on pull requests
+ // use a free "ubuntu" runner on jobs that are skipped
+
+ // skip_pr is shorthand for skip = github.event_name == 'pull_request'.
if (item.skip_pr != null) {
- let text = "${{ github.event_name == 'pull_request' && ";
- if (typeof item.skip_pr === "string") {
- text += removeSurroundingExpression(item.skip_pr.toString()) + " && ";
+ if (item.skip_pr === true) {
+ item.skip = "${{ github.event_name == 'pull_request' }}";
+ } else if (typeof item.skip_pr === "string") {
+ item.skip = "${{ github.event_name == 'pull_request' && " +
+ removeSurroundingExpression(item.skip_pr.toString()) + " }}";
}
+ delete item.skip_pr;
+ }
+
+ if (typeof item.skip === "string") {
+ let text = "${{ (";
+ text += removeSurroundingExpression(item.skip.toString()) + ") && ";
text += `'${Runners.ubuntu}' || ${
removeSurroundingExpression(item.os)
} }}`;
@@ -267,6 +284,7 @@ function handleMatrixItems(items: {
// deno-lint-ignore no-explicit-any
(item as any).runner = text;
}
+
return {
...item,
os_display_name: getOsDisplayName(item.os),
@@ -344,6 +362,13 @@ const ci = {
profile: "release",
skip_pr: true,
}, {
+ os: Runners.macosArm,
+ job: "test",
+ profile: "release",
+ // TODO(mmastrac): We don't want to run this M1 runner on every main commit because of the expense.
+ skip:
+ "${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }}",
+ }, {
os: Runners.windows,
job: "test",
profile: "debug",
@@ -498,6 +523,14 @@ const ci = {
...sysRootStep,
},
{
+ name: "Install aarch64 lld",
+ run: [
+ "./tools/install_prebuilt.js ld64.lld",
+ "echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH",
+ ].join("\n"),
+ if: `matrix.os == '${macosArmRunner}'`,
+ },
+ {
name: "Log versions",
run: [
"python --version",
@@ -601,9 +634,7 @@ const ci = {
if: [
"(matrix.job == 'test' || matrix.job == 'bench') &&",
"matrix.profile == 'release' && (matrix.use_sysroot ||",
- "(github.repository == 'denoland/deno' &&",
- "(github.ref == 'refs/heads/main' ||",
- "startsWith(github.ref, 'refs/tags/'))))",
+ "github.repository == 'denoland/deno')",
].join("\n"),
run: [
// output fs space before and after building
@@ -642,13 +673,12 @@ const ci = {
].join("\n"),
},
{
- name: "Pre-release (mac)",
+ name: "Pre-release (mac intel)",
if: [
- "startsWith(matrix.os, 'macOS') &&",
+ `matrix.os == '${macosX86Runner}' &&`,
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
- "github.repository == 'denoland/deno' &&",
- "(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))",
+ "github.repository == 'denoland/deno'",
].join("\n"),
run: [
"cd target/release",
@@ -657,13 +687,26 @@ const ci = {
.join("\n"),
},
{
+ name: "Pre-release (mac aarch64)",
+ if: [
+ `matrix.os == '${macosArmRunner}' &&`,
+ "matrix.job == 'test' &&",
+ "matrix.profile == 'release' &&",
+ "github.repository == 'denoland/deno'",
+ ].join("\n"),
+ run: [
+ "cd target/release",
+ "zip -r deno-aarch64-apple-darwin.zip deno",
+ ]
+ .join("\n"),
+ },
+ {
name: "Pre-release (windows)",
if: [
"startsWith(matrix.os, 'windows') &&",
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
- "github.repository == 'denoland/deno' &&",
- "(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))",
+ "github.repository == 'denoland/deno'",
].join("\n"),
shell: "pwsh",
run:
@@ -718,7 +761,7 @@ const ci = {
name: "Test debug (fast)",
if: [
"matrix.job == 'test' && matrix.profile == 'debug' &&",
- "!startsWith(matrix.os, 'ubuntu')",
+ "(startsWith(github.ref, 'refs/tags/') || !startsWith(matrix.os, 'ubuntu'))",
].join("\n"),
run: [
// Run unit then integration tests. Skip doc tests here
@@ -734,7 +777,7 @@ const ci = {
"matrix.job == 'test' && matrix.profile == 'release' &&",
"(matrix.use_sysroot || (",
"github.repository == 'denoland/deno' &&",
- "github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')))",
+ "!startsWith(github.ref, 'refs/tags/')))",
].join("\n"),
run: "cargo test --release --locked",
},
@@ -939,6 +982,7 @@ const ci = {
"target/release/deno-x86_64-pc-windows-msvc.zip",
"target/release/deno-x86_64-unknown-linux-gnu.zip",
"target/release/deno-x86_64-apple-darwin.zip",
+ "target/release/deno-aarch64-apple-darwin.zip",
"target/release/deno_src.tar.gz",
"target/release/lib.deno.d.ts",
].join("\n"),
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c0d957fb4..2a88523cb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -60,9 +60,15 @@ jobs:
- os: macos-12
job: test
profile: release
- skip_pr: true
- runner: '${{ github.event_name == ''pull_request'' && ''ubuntu-22.04'' || ''macos-12'' }}'
+ skip: '${{ github.event_name == ''pull_request'' }}'
+ runner: '${{ (github.event_name == ''pull_request'') && ''ubuntu-22.04'' || ''macos-12'' }}'
os_display_name: macos-x86_64
+ - os: macos-13-xlarge
+ job: test
+ profile: release
+ skip: '${{ github.event_name == ''pull_request'' || github.ref == ''refs/heads/main'' }}'
+ runner: '${{ (github.event_name == ''pull_request'' || github.ref == ''refs/heads/main'') && ''ubuntu-22.04'' || ''macos-13-xlarge'' }}'
+ os_display_name: macos-aarch64
- os: windows-2022
job: test
profile: debug
@@ -70,8 +76,8 @@ jobs:
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
job: test
profile: release
- skip_pr: true
- runner: '${{ github.event_name == ''pull_request'' && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
+ skip: '${{ github.event_name == ''pull_request'' }}'
+ runner: '${{ (github.event_name == ''pull_request'') && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
os_display_name: windows-x86_64
- os: '${{ github.repository == ''denoland/deno'' && ''ubuntu-22.04-xl'' || ''ubuntu-22.04'' }}'
job: test
@@ -83,8 +89,8 @@ jobs:
job: bench
profile: release
use_sysroot: true
- skip_pr: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-bench'') }}'
- runner: '${{ github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench'') && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''ubuntu-22.04-xl'' || ''ubuntu-22.04'' }}'
+ skip: '${{ github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench'') }}'
+ runner: '${{ (github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench'')) && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''ubuntu-22.04-xl'' || ''ubuntu-22.04'' }}'
os_display_name: ubuntu-x86_64
- os: ubuntu-22.04
job: test
@@ -109,7 +115,7 @@ jobs:
RUST_BACKTRACE: full
steps:
- name: Reconfigure Windows Storage
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (startsWith(matrix.os, ''windows'') && !endsWith(matrix.os, ''-xl''))'
+ if: '!(matrix.skip) && (startsWith(matrix.os, ''windows'') && !endsWith(matrix.os, ''-xl''))'
shell: pwsh
run: |-
New-Item -ItemType "directory" -Path "$env:TEMP/__target__"
@@ -118,25 +124,25 @@ jobs:
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: false
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- name: Clone submodule ./test_util/std
run: git submodule update --init --recursive --depth=1 -- ./test_util/std
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- name: Clone submodule ./test_util/wpt
run: git submodule update --init --recursive --depth=1 -- ./test_util/wpt
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.wpt)'
+ if: '!(matrix.skip) && (matrix.wpt)'
- name: Clone submodule ./tools/node_compat/node
run: git submodule update --init --recursive --depth=1 -- ./tools/node_compat/node
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
+ if: '!(matrix.skip) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
- name: 'Create source tarballs (release, linux)'
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'ubuntu') &&
+ !(matrix.skip) && (startsWith(matrix.os, 'ubuntu') &&
matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
@@ -146,8 +152,8 @@ jobs:
tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
-czvf target/release/deno_src.tar.gz -C .. deno
- uses: dsherret/rust-toolchain-file@v1
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- - if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' || matrix.job == ''test'' || matrix.job == ''bench'')'
+ if: '!(matrix.skip)'
+ - if: '!(matrix.skip) && (matrix.job == ''lint'' || matrix.job == ''test'' || matrix.job == ''bench'')'
name: Install Deno
uses: denoland/setup-deno@v1
with:
@@ -156,16 +162,16 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.11
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job != ''lint'')'
+ if: '!(matrix.skip) && (matrix.job != ''lint'')'
- name: Remove unused versions of Python
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job != ''lint'' && (startsWith(matrix.os, ''windows'')))'
+ if: '!(matrix.skip) && (matrix.job != ''lint'' && (startsWith(matrix.os, ''windows'')))'
shell: pwsh
run: |-
$env:PATH -split ";" |
Where-Object { Test-Path "$_\python.exe" } |
Select-Object -Skip 1 |
ForEach-Object { Move-Item "$_" "$_.disabled" }
- - if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''bench'')'
+ - if: '!(matrix.skip) && (matrix.job == ''bench'')'
name: Install Node
uses: actions/setup-node@v3
with:
@@ -175,9 +181,9 @@ jobs:
with:
version: '21.12'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.profile == 'release' &&
+ !(matrix.skip) && (matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' ||
@@ -191,7 +197,7 @@ jobs:
create_credentials_file: true
- name: Setup gcloud (unix)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os != 'Windows' &&
+ !(matrix.skip) && (runner.os != 'Windows' &&
matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
@@ -202,7 +208,7 @@ jobs:
project_id: denoland
- name: Setup gcloud (windows)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os == 'Windows' &&
+ !(matrix.skip) && (runner.os == 'Windows' &&
matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
@@ -215,12 +221,12 @@ jobs:
project_id: denoland
- name: Configure canary build
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' &&
+ !(matrix.skip) && (matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
github.ref == 'refs/heads/main')
run: echo "DENO_CANARY=true" >> $GITHUB_ENV
- - if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.use_sysroot)'
+ - if: '!(matrix.skip) && (matrix.use_sysroot)'
name: Set up incremental LTO and sysroot build
run: |-
# Avoid running man-db triggers, which sometimes takes several minutes
@@ -294,6 +300,11 @@ jobs:
CC=clang-16
CFLAGS=-flto=thin --sysroot=/sysroot
__0
+ - name: Install aarch64 lld
+ run: |-
+ ./tools/install_prebuilt.js ld64.lld
+ echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
+ if: '!(matrix.skip) && (matrix.os == ''macos-13-xlarge'')'
- name: Log versions
run: |-
python --version
@@ -308,7 +319,7 @@ jobs:
node -v
./tools/install_prebuilt.js wrk hyperfine
fi
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- name: Cache Cargo home
uses: actions/cache@v3
with:
@@ -317,10 +328,10 @@ jobs:
~/.cargo/registry/cache
key: '59-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '59-cargo-home-${{ matrix.os }}'
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
+ if: '!(matrix.skip)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v3
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
+ if: '!(matrix.skip) && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
with:
path: |-
./target
@@ -330,26 +341,26 @@ jobs:
key: never_saved
restore-keys: '59-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (!startsWith(github.ref, ''refs/tags/''))'
+ if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
with:
cache-path: ./target
- name: test_format.js
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
+ if: '!(matrix.skip) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
run: deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check
- name: Lint PR title
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && github.event_name == ''pull_request'' && startsWith(matrix.os, ''ubuntu''))'
+ if: '!(matrix.skip) && (matrix.job == ''lint'' && github.event_name == ''pull_request'' && startsWith(matrix.os, ''ubuntu''))'
env:
PR_TITLE: '${{ github.event.pull_request.title }}'
run: deno run ./tools/verify_pr_title.js "$PR_TITLE"
- name: lint.js
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'')'
+ if: '!(matrix.skip) && (matrix.job == ''lint'')'
run: deno run --unstable --allow-write --allow-read --allow-run --allow-net ./tools/lint.js
- name: node_compat/setup.ts --check
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
+ if: '!(matrix.skip) && (matrix.job == ''lint'' && startsWith(matrix.os, ''ubuntu''))'
run: deno run --allow-write --allow-read --allow-run=git ./tools/node_compat/setup.ts --check
- name: Build debug
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''test'' && matrix.profile == ''debug'')'
+ if: '!(matrix.skip) && (matrix.job == ''test'' && matrix.profile == ''debug'')'
run: |-
df -h
cargo build --locked --all-targets
@@ -358,18 +369,16 @@ jobs:
CARGO_PROFILE_DEV_DEBUG: 0
- name: Build release
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && ((matrix.job == 'test' || matrix.job == 'bench') &&
+ !(matrix.skip) && ((matrix.job == 'test' || matrix.job == 'bench') &&
matrix.profile == 'release' && (matrix.use_sysroot ||
- (github.repository == 'denoland/deno' &&
- (github.ref == 'refs/heads/main' ||
- startsWith(github.ref, 'refs/tags/')))))
+ github.repository == 'denoland/deno'))
run: |-
df -h
cargo build --release --locked --all-targets
df -h
- name: Upload PR artifact (linux)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' &&
+ !(matrix.skip) && (matrix.job == 'test' &&
matrix.profile == 'release' && (matrix.use_sysroot ||
(github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' ||
@@ -380,7 +389,7 @@ jobs:
path: target/release/deno
- name: Pre-release (linux)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'ubuntu') &&
+ !(matrix.skip) && (startsWith(matrix.os, 'ubuntu') &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno')
@@ -388,28 +397,35 @@ jobs:
cd target/release
zip -r deno-x86_64-unknown-linux-gnu.zip deno
./deno types > lib.deno.d.ts
- - name: Pre-release (mac)
+ - name: Pre-release (mac intel)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'macOS') &&
+ !(matrix.skip) && (matrix.os == 'macos-12' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
- github.repository == 'denoland/deno' &&
- (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')))
+ github.repository == 'denoland/deno')
run: |-
cd target/release
zip -r deno-x86_64-apple-darwin.zip deno
+ - name: Pre-release (mac aarch64)
+ if: |-
+ !(matrix.skip) && (matrix.os == 'macos-13-xlarge' &&
+ matrix.job == 'test' &&
+ matrix.profile == 'release' &&
+ github.repository == 'denoland/deno')
+ run: |-
+ cd target/release
+ zip -r deno-aarch64-apple-darwin.zip deno
- name: Pre-release (windows)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'windows') &&
+ !(matrix.skip) && (startsWith(matrix.os, 'windows') &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
- github.repository == 'denoland/deno' &&
- (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')))
+ github.repository == 'denoland/deno')
shell: pwsh
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip
- name: Upload canary to dl.deno.land (unix)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os != 'Windows' &&
+ !(matrix.skip) && (runner.os != 'Windows' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -417,7 +433,7 @@ jobs:
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
- name: Upload canary to dl.deno.land (windows)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os == 'Windows' &&
+ !(matrix.skip) && (runner.os == 'Windows' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -427,20 +443,20 @@ jobs:
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
- name: Autobahn testsuite
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'release' &&
+ !(matrix.skip) && (matrix.job == 'test' && matrix.profile == 'release' &&
!startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu'))
run: target/release/deno run -A --unstable ext/websocket/autobahn/fuzzingclient.js
- name: Test debug
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'debug' &&
+ !(matrix.skip) && (matrix.job == 'test' && matrix.profile == 'debug' &&
!startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu'))
run: cargo test --locked
env:
CARGO_PROFILE_DEV_DEBUG: 0
- name: Test debug (fast)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'debug' &&
- !startsWith(matrix.os, 'ubuntu'))
+ !(matrix.skip) && (matrix.job == 'test' && matrix.profile == 'debug' &&
+ (startsWith(github.ref, 'refs/tags/') || !startsWith(matrix.os, 'ubuntu')))
run: |-
cargo test --locked --lib
cargo test --locked --test '*'
@@ -448,25 +464,25 @@ jobs:
CARGO_PROFILE_DEV_DEBUG: 0
- name: Test release
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' && matrix.profile == 'release' &&
+ !(matrix.skip) && (matrix.job == 'test' && matrix.profile == 'release' &&
(matrix.use_sysroot || (
github.repository == 'denoland/deno' &&
- github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/'))))
+ !startsWith(github.ref, 'refs/tags/'))))
run: cargo test --release --locked
- name: Check deno binary
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.profile == ''release'' && startsWith(github.ref, ''refs/tags/''))'
+ if: '!(matrix.skip) && (matrix.profile == ''release'' && startsWith(github.ref, ''refs/tags/''))'
run: target/release/deno eval "console.log(1+2)" | grep 3
env:
NO_COLOR: 1
- name: Check deno binary (in sysroot)
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.profile == ''release'' && matrix.use_sysroot)'
+ if: '!(matrix.skip) && (matrix.profile == ''release'' && matrix.use_sysroot)'
run: sudo chroot /sysroot "$(pwd)/target/release/deno" --version
- name: Configure hosts file for WPT
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.wpt)'
+ if: '!(matrix.skip) && (matrix.wpt)'
run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
working-directory: test_util/wpt/
- name: Run web platform tests (debug)
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.wpt && matrix.profile == ''debug'')'
+ if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''debug'')'
env:
DENO_BIN: ./target/debug/deno
run: |-
@@ -479,7 +495,7 @@ jobs:
--lock=tools/deno.lock.json \
./tools/wpt.ts run --quiet --binary="$DENO_BIN"
- name: Run web platform tests (release)
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.wpt && matrix.profile == ''release'')'
+ if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''release'')'
env:
DENO_BIN: ./target/release/deno
run: |-
@@ -497,7 +513,7 @@ jobs:
- name: Upload wpt results to dl.deno.land
continue-on-error: true
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.wpt &&
+ !(matrix.skip) && (matrix.wpt &&
runner.os == 'Linux' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -511,7 +527,7 @@ jobs:
- name: Upload wpt results to wpt.fyi
continue-on-error: true
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.wpt &&
+ !(matrix.skip) && (matrix.wpt &&
runner.os == 'Linux' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -524,11 +540,11 @@ jobs:
./target/release/deno run --allow-all --lock=tools/deno.lock.json \
./tools/upload_wptfyi.js $(git rev-parse HEAD) --ghstatus
- name: Run benchmarks
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''bench'' && !startsWith(github.ref, ''refs/tags/''))'
+ if: '!(matrix.skip) && (matrix.job == ''bench'' && !startsWith(github.ref, ''refs/tags/''))'
run: cargo bench --locked
- name: Post Benchmarks
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'bench' &&
+ !(matrix.skip) && (matrix.job == 'bench' &&
github.repository == 'denoland/deno' &&
github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/'))
env:
@@ -546,18 +562,18 @@ jobs:
git commit --message "Update benchmarks"
git push origin gh-pages
- name: Build product size info
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job != ''lint'' && matrix.profile != ''debug'' && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')))'
+ if: '!(matrix.skip) && (matrix.job != ''lint'' && matrix.profile != ''debug'' && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')))'
run: |-
du -hd1 "./target/${{ matrix.profile }}"
du -ha "./target/${{ matrix.profile }}/deno"
- name: Worker info
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (matrix.job == ''bench'')'
+ if: '!(matrix.skip) && (matrix.job == ''bench'')'
run: |-
cat /proc/cpuinfo
cat /proc/meminfo
- name: Upload release to dl.deno.land (unix)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os != 'Windows' &&
+ !(matrix.skip) && (runner.os != 'Windows' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -565,7 +581,7 @@ jobs:
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/'
- name: Upload release to dl.deno.land (windows)
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (runner.os == 'Windows' &&
+ !(matrix.skip) && (runner.os == 'Windows' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
@@ -575,7 +591,7 @@ jobs:
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/'
- name: Create release notes
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' &&
+ !(matrix.skip) && (matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
startsWith(github.ref, 'refs/tags/'))
@@ -585,7 +601,7 @@ jobs:
- name: Upload release to GitHub
uses: softprops/action-gh-release@v0.1.15
if: |-
- !(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.job == 'test' &&
+ !(matrix.skip) && (matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
startsWith(github.ref, 'refs/tags/'))
@@ -596,13 +612,14 @@ jobs:
target/release/deno-x86_64-pc-windows-msvc.zip
target/release/deno-x86_64-unknown-linux-gnu.zip
target/release/deno-x86_64-apple-darwin.zip
+ target/release/deno-aarch64-apple-darwin.zip
target/release/deno_src.tar.gz
target/release/lib.deno.d.ts
body_path: target/release/release-notes.md
draft: true
- name: Save cache build output (main)
uses: actions/cache/save@v3
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && ((matrix.job == ''test'' || matrix.job == ''lint'') && github.ref == ''refs/heads/main'')'
+ if: '!(matrix.skip) && ((matrix.job == ''test'' || matrix.job == ''lint'') && github.ref == ''refs/heads/main'')'
with:
path: |-
./target
diff --git a/tools/util.js b/tools/util.js
index 0d57213e0..95eccbfe3 100644
--- a/tools/util.js
+++ b/tools/util.js
@@ -19,6 +19,8 @@ const versions = {
"dlint": "dlint 0.51.0",
};
+const compressed = new Set(["ld64.lld"]);
+
export const ROOT_PATH = dirname(dirname(fromFileUrl(import.meta.url)));
async function getFilesFromGit(baseDir, args) {
@@ -176,7 +178,7 @@ export function getPrebuiltToolPath(toolName) {
}
const downloadUrl =
- `https://raw.githubusercontent.com/denoland/deno_third_party/69ffd968c0c435f5f9dbba713a92b4fb6a3e2301/prebuilt/${platformDirName}`;
+ `https://raw.githubusercontent.com/denoland/deno_third_party/1fd66ef78ab40841db833d4a1efd5c5597faf066/prebuilt/${platformDirName}`;
export async function downloadPrebuilt(toolName) {
// Ensure only one download per tool happens at a time
@@ -195,7 +197,10 @@ export async function downloadPrebuilt(toolName) {
try {
await Deno.mkdir(PREBUILT_TOOL_DIR, { recursive: true });
- const url = `${downloadUrl}/${toolName}${executableSuffix}`;
+ let url = `${downloadUrl}/${toolName}${executableSuffix}`;
+ if (compressed.has(toolName)) {
+ url += ".gz";
+ }
const resp = await fetch(url);
if (!resp.ok) {
@@ -208,7 +213,13 @@ export async function downloadPrebuilt(toolName) {
mode: 0o755,
});
- await resp.body.pipeTo(file.writable);
+ if (compressed.has(toolName)) {
+ await resp.body.pipeThrough(new DecompressionStream("gzip")).pipeTo(
+ file.writable,
+ );
+ } else {
+ await resp.body.pipeTo(file.writable);
+ }
spinner.text = `Checking prebuilt tool: ${toolName}`;
await sanityCheckPrebuiltFile(tempFile);
if (!await verifyVersion(toolName, tempFile)) {