mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
parent
675179a176
commit
de4667febe
3 changed files with 16 additions and 17 deletions
14
.github/workflows/ci.generate.ts
vendored
14
.github/workflows/ci.generate.ts
vendored
|
@ -149,7 +149,6 @@ function cancelEarlyIfDraftPr(
|
||||||
name: "Cancel if draft PR",
|
name: "Cancel if draft PR",
|
||||||
id: "exit_early",
|
id: "exit_early",
|
||||||
if: "github.event.pull_request.draft == true",
|
if: "github.event.pull_request.draft == true",
|
||||||
shell: "bash",
|
|
||||||
run: [
|
run: [
|
||||||
"GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})",
|
"GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})",
|
||||||
"echo Commit message: $GIT_MESSAGE",
|
"echo Commit message: $GIT_MESSAGE",
|
||||||
|
@ -214,6 +213,12 @@ const ci = {
|
||||||
name: "${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}",
|
name: "${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}",
|
||||||
"runs-on": "${{ matrix.runner || matrix.os }}",
|
"runs-on": "${{ matrix.runner || matrix.os }}",
|
||||||
"timeout-minutes": 120,
|
"timeout-minutes": 120,
|
||||||
|
defaults: {
|
||||||
|
run: {
|
||||||
|
// GH actions doesn't use `set -e` by default unless you specify bash
|
||||||
|
shell: "bash",
|
||||||
|
},
|
||||||
|
},
|
||||||
strategy: {
|
strategy: {
|
||||||
matrix: {
|
matrix: {
|
||||||
include: [
|
include: [
|
||||||
|
@ -391,7 +396,6 @@ const ci = {
|
||||||
"github.repository == 'denoland/deno' &&",
|
"github.repository == 'denoland/deno' &&",
|
||||||
"github.ref == 'refs/heads/main'",
|
"github.ref == 'refs/heads/main'",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
shell: "bash",
|
|
||||||
run: 'echo "DENO_CANARY=true" >> $GITHUB_ENV',
|
run: 'echo "DENO_CANARY=true" >> $GITHUB_ENV',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -400,7 +404,6 @@ const ci = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Log versions",
|
name: "Log versions",
|
||||||
shell: "bash",
|
|
||||||
run: [
|
run: [
|
||||||
"python --version",
|
"python --version",
|
||||||
"rustc --version",
|
"rustc --version",
|
||||||
|
@ -464,7 +467,6 @@ const ci = {
|
||||||
// identifier '1ecc6299db9ec823' will ever change, but if it does then this
|
// identifier '1ecc6299db9ec823' will ever change, but if it does then this
|
||||||
// command must be updated.
|
// command must be updated.
|
||||||
name: "Shallow clone crates.io index",
|
name: "Shallow clone crates.io index",
|
||||||
shell: "bash",
|
|
||||||
run: [
|
run: [
|
||||||
"if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]",
|
"if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]",
|
||||||
"then",
|
"then",
|
||||||
|
@ -591,7 +593,6 @@ const ci = {
|
||||||
env: {
|
env: {
|
||||||
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
||||||
},
|
},
|
||||||
shell: "bash",
|
|
||||||
run:
|
run:
|
||||||
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
|
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
|
||||||
},
|
},
|
||||||
|
@ -634,7 +635,6 @@ const ci = {
|
||||||
name: "Check deno binary",
|
name: "Check deno binary",
|
||||||
if:
|
if:
|
||||||
"matrix.profile == 'release' && startsWith(github.ref, 'refs/tags/')",
|
"matrix.profile == 'release' && startsWith(github.ref, 'refs/tags/')",
|
||||||
shell: "bash",
|
|
||||||
run: 'target/release/deno eval "console.log(1+2)" | grep 3',
|
run: 'target/release/deno eval "console.log(1+2)" | grep 3',
|
||||||
env: {
|
env: {
|
||||||
NO_COLOR: 1,
|
NO_COLOR: 1,
|
||||||
|
@ -798,13 +798,11 @@ const ci = {
|
||||||
env: {
|
env: {
|
||||||
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
||||||
},
|
},
|
||||||
shell: "bash",
|
|
||||||
run:
|
run:
|
||||||
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
|
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Create release notes",
|
name: "Create release notes",
|
||||||
shell: "bash",
|
|
||||||
if: [
|
if: [
|
||||||
"matrix.job == 'test' &&",
|
"matrix.job == 'test' &&",
|
||||||
"matrix.profile == 'release' &&",
|
"matrix.profile == 'release' &&",
|
||||||
|
|
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
@ -21,6 +21,9 @@ jobs:
|
||||||
name: '${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}'
|
name: '${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}'
|
||||||
runs-on: '${{ matrix.runner || matrix.os }}'
|
runs-on: '${{ matrix.runner || matrix.os }}'
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -76,7 +79,6 @@ jobs:
|
||||||
- name: Cancel if draft PR
|
- name: Cancel if draft PR
|
||||||
id: exit_early
|
id: exit_early
|
||||||
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (github.event.pull_request.draft == true)'
|
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (github.event.pull_request.draft == true)'
|
||||||
shell: bash
|
|
||||||
run: |-
|
run: |-
|
||||||
GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
|
GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
|
||||||
echo Commit message: $GIT_MESSAGE
|
echo Commit message: $GIT_MESSAGE
|
||||||
|
@ -169,7 +171,6 @@ jobs:
|
||||||
matrix.profile == 'release' &&
|
matrix.profile == 'release' &&
|
||||||
github.repository == 'denoland/deno' &&
|
github.repository == 'denoland/deno' &&
|
||||||
github.ref == 'refs/heads/main'))
|
github.ref == 'refs/heads/main'))
|
||||||
shell: bash
|
|
||||||
run: echo "DENO_CANARY=true" >> $GITHUB_ENV
|
run: echo "DENO_CANARY=true" >> $GITHUB_ENV
|
||||||
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (matrix.use_sysroot))'
|
- if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (matrix.use_sysroot))'
|
||||||
name: Set up incremental LTO and sysroot build
|
name: Set up incremental LTO and sysroot build
|
||||||
|
@ -241,7 +242,6 @@ jobs:
|
||||||
CFLAGS=-flto=thin --sysroot=/sysroot
|
CFLAGS=-flto=thin --sysroot=/sysroot
|
||||||
__0
|
__0
|
||||||
- name: Log versions
|
- name: Log versions
|
||||||
shell: bash
|
|
||||||
run: |-
|
run: |-
|
||||||
python --version
|
python --version
|
||||||
rustc --version
|
rustc --version
|
||||||
|
@ -281,7 +281,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
cache-path: ./target
|
cache-path: ./target
|
||||||
- name: Shallow clone crates.io index
|
- name: Shallow clone crates.io index
|
||||||
shell: bash
|
|
||||||
run: |-
|
run: |-
|
||||||
if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]
|
if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]
|
||||||
then
|
then
|
||||||
|
@ -370,7 +369,6 @@ jobs:
|
||||||
github.ref == 'refs/heads/main'))
|
github.ref == 'refs/heads/main'))
|
||||||
env:
|
env:
|
||||||
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
||||||
shell: bash
|
|
||||||
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
|
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
|
||||||
- name: Test debug
|
- name: Test debug
|
||||||
if: |-
|
if: |-
|
||||||
|
@ -397,7 +395,6 @@ jobs:
|
||||||
run: cargo test --release --locked
|
run: cargo test --release --locked
|
||||||
- name: Check deno binary
|
- name: Check deno binary
|
||||||
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (matrix.profile == ''release'' && startsWith(github.ref, ''refs/tags/'')))'
|
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (matrix.profile == ''release'' && startsWith(github.ref, ''refs/tags/'')))'
|
||||||
shell: bash
|
|
||||||
run: target/release/deno eval "console.log(1+2)" | grep 3
|
run: target/release/deno eval "console.log(1+2)" | grep 3
|
||||||
env:
|
env:
|
||||||
NO_COLOR: 1
|
NO_COLOR: 1
|
||||||
|
@ -515,10 +512,8 @@ jobs:
|
||||||
startsWith(github.ref, 'refs/tags/')))
|
startsWith(github.ref, 'refs/tags/')))
|
||||||
env:
|
env:
|
||||||
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
||||||
shell: bash
|
|
||||||
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/'
|
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
|
- name: Create release notes
|
||||||
shell: bash
|
|
||||||
if: |-
|
if: |-
|
||||||
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.job == 'test' &&
|
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.job == 'test' &&
|
||||||
matrix.profile == 'release' &&
|
matrix.profile == 'release' &&
|
||||||
|
|
|
@ -165,7 +165,13 @@ mod tests {
|
||||||
fn located_script_name() {
|
fn located_script_name() {
|
||||||
// Note that this test will fail if this file is moved. We don't
|
// Note that this test will fail if this file is moved. We don't
|
||||||
// test line locations because that's just too brittle.
|
// test line locations because that's just too brittle.
|
||||||
assert!(located_script_name!().starts_with("[ext:core/lib.rs:"));
|
let name = located_script_name!();
|
||||||
|
let expected = if cfg!(windows) {
|
||||||
|
"[ext:core\\lib.rs:"
|
||||||
|
} else {
|
||||||
|
"[ext:core/lib.rs:"
|
||||||
|
};
|
||||||
|
assert_eq!(&name[..expected.len()], expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Reference in a new issue