1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore: fix located_script_name test (#18418)

Closes #18417
This commit is contained in:
David Sherret 2023-03-24 12:00:47 -04:00 committed by GitHub
parent 675179a176
commit de4667febe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 17 deletions

View file

@ -149,7 +149,6 @@ function cancelEarlyIfDraftPr(
name: "Cancel if draft PR",
id: "exit_early",
if: "github.event.pull_request.draft == true",
shell: "bash",
run: [
"GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})",
"echo Commit message: $GIT_MESSAGE",
@ -214,6 +213,12 @@ const ci = {
name: "${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}",
"runs-on": "${{ matrix.runner || matrix.os }}",
"timeout-minutes": 120,
defaults: {
run: {
// GH actions doesn't use `set -e` by default unless you specify bash
shell: "bash",
},
},
strategy: {
matrix: {
include: [
@ -391,7 +396,6 @@ const ci = {
"github.repository == 'denoland/deno' &&",
"github.ref == 'refs/heads/main'",
].join("\n"),
shell: "bash",
run: 'echo "DENO_CANARY=true" >> $GITHUB_ENV',
},
{
@ -400,7 +404,6 @@ const ci = {
},
{
name: "Log versions",
shell: "bash",
run: [
"python --version",
"rustc --version",
@ -464,7 +467,6 @@ const ci = {
// identifier '1ecc6299db9ec823' will ever change, but if it does then this
// command must be updated.
name: "Shallow clone crates.io index",
shell: "bash",
run: [
"if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]",
"then",
@ -591,7 +593,6 @@ const ci = {
env: {
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)/',
},
@ -634,7 +635,6 @@ const ci = {
name: "Check deno binary",
if:
"matrix.profile == 'release' && startsWith(github.ref, 'refs/tags/')",
shell: "bash",
run: 'target/release/deno eval "console.log(1+2)" | grep 3',
env: {
NO_COLOR: 1,
@ -798,13 +798,11 @@ const ci = {
env: {
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/*/}/',
},
{
name: "Create release notes",
shell: "bash",
if: [
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",

View file

@ -21,6 +21,9 @@ jobs:
name: '${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}'
runs-on: '${{ matrix.runner || matrix.os }}'
timeout-minutes: 120
defaults:
run:
shell: bash
strategy:
matrix:
include:
@ -76,7 +79,6 @@ jobs:
- name: Cancel if draft PR
id: exit_early
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (github.event.pull_request.draft == true)'
shell: bash
run: |-
GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
echo Commit message: $GIT_MESSAGE
@ -169,7 +171,6 @@ jobs:
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
github.ref == 'refs/heads/main'))
shell: bash
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))'
name: Set up incremental LTO and sysroot build
@ -241,7 +242,6 @@ jobs:
CFLAGS=-flto=thin --sysroot=/sysroot
__0
- name: Log versions
shell: bash
run: |-
python --version
rustc --version
@ -281,7 +281,6 @@ jobs:
with:
cache-path: ./target
- name: Shallow clone crates.io index
shell: bash
run: |-
if [ ! -d ~/.cargo/registry/index/github.com-1ecc6299db9ec823/.git ]
then
@ -370,7 +369,6 @@ jobs:
github.ref == 'refs/heads/main'))
env:
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)/'
- name: Test debug
if: |-
@ -397,7 +395,6 @@ jobs:
run: cargo test --release --locked
- 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/'')))'
shell: bash
run: target/release/deno eval "console.log(1+2)" | grep 3
env:
NO_COLOR: 1
@ -515,10 +512,8 @@ jobs:
startsWith(github.ref, 'refs/tags/')))
env:
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/*/}/'
- name: Create release notes
shell: bash
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.job == 'test' &&
matrix.profile == 'release' &&

View file

@ -165,7 +165,13 @@ mod tests {
fn located_script_name() {
// Note that this test will fail if this file is moved. We don't
// 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]