From 91857bc938f4cbf67ee03969a6f17bd015df31ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Wed, 13 Dec 2023 19:26:35 -0800 Subject: [PATCH 01/18] Upload releases for musl-libc and android --- .github/workflows/build-android.yaml | 70 ++++++++++++++++++++ .github/workflows/build-linux-musl.yaml | 88 +++++++++++++++++++++++++ .github/workflows/ci.yml | 68 +++++++++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 .github/workflows/build-android.yaml create mode 100644 .github/workflows/build-linux-musl.yaml diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml new file mode 100644 index 000000000..a696bf17f --- /dev/null +++ b/.github/workflows/build-android.yaml @@ -0,0 +1,70 @@ +name: Build for android + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + lib: lib64 + platform: linux/amd64 + - arch: ia32 + lib: lib + platform: linux/amd64 + - arch: arm64 + lib: lib64 + platform: linux/arm64 + - arch: arm + lib: lib + platform: linux/arm64 + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:master # need qemu >= 7.0.0 + + - name: Compile Protobuf + run: | + docker run --rm -i \ + --volume $PWD:$PWD \ + --workdir $PWD \ + docker.io/library/dart <<'EOF' + set -e + curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 + dart pub get + dart run grinder protobuf + EOF + + - name: Build + run: | + docker run --rm -i \ + --platform ${{ matrix.platform }} \ + --privileged \ + --volume $PWD:$PWD \ + --workdir $PWD \ + ghcr.io/dart-android/dart <<'EOF' + set -e + export DART_SDK=/system/${{ matrix.lib }}/dart + export PATH=$DART_SDK/bin:$PATH + dart pub get + dart run grinder pkg-standalone-android-${{ matrix.arch }} + EOF + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: build-android-${{ matrix.arch }} + path: build/*.tar.gz + if-no-files-found: error diff --git a/.github/workflows/build-linux-musl.yaml b/.github/workflows/build-linux-musl.yaml new file mode 100644 index 000000000..3e4d8f700 --- /dev/null +++ b/.github/workflows/build-linux-musl.yaml @@ -0,0 +1,88 @@ +name: Build for linux-musl + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + platform: linux/amd64 + - arch: ia32 + platform: linux/386 + - arch: arm64 + platform: linux/arm64 + - arch: arm + platform: linux/arm/v7 + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Compile Protobuf + run: | + docker run --rm -i \ + --volume $PWD:$PWD \ + --workdir $PWD \ + docker.io/library/dart <<'EOF' + set -e + curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 + dart pub get + dart run grinder protobuf + EOF + + # There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm. + # Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot + # for arm on CI. So, we create an kernel snapshot for arm build in amd64 container instead. + # + # In addition, we need to rename the artifact from -linux- to -linux-musl- to avoid conflict + # with glibc builds. + - name: Build + run: | + docker run --rm -i \ + --platform ${{ matrix.arch == 'arm' && 'linux/amd64' || matrix.platform }} \ + --volume $PWD:$PWD \ + --workdir $PWD \ + ghcr.io/dart-musl/dart <<'EOF' + set -e + dart pub get + dart run grinder pkg-standalone-linux-${{ matrix.arch }} + find build -name '*.tar.gz' -print0 | xargs -0 -n 1 -- sh -xc 'mv "$1" "$(echo "$1" | sed -e "s/linux/linux-musl/")"' -- + EOF + + # The kernel snapshot created for arm in the previous step is bundling a glibc based dart runtime + # due to how cli_pkg download the sdk for building non-native platforms. Therefore we need to + # replace it with musl-libc based dart runtime to create a working linux-musl-arm package. + - name: Fix Dart Runtime + if: matrix.arch == 'arm' + run: | + docker run --rm -i \ + --platform ${{ matrix.platform }} \ + --volume $PWD:$PWD \ + --workdir $PWD \ + ghcr.io/dart-musl/dart <<'EOF' + set -e + apk add --no-cache tar + cd build + DART_RUNTIME=$(tar -tzf *.tar.gz --wildcards "*/src/dart") + tar -xzf *.tar.gz + cp $DART_SDK/bin/dart $DART_RUNTIME + tar -czf *.tar.gz "$(dirname "$(dirname "$DART_RUNTIME")")" + EOF + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: build-linux-musl-${{ matrix.arch }} + path: build/*.tar.gz + if-no-files-found: error diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e55102c9..525fec0b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -612,6 +612,74 @@ jobs: message: Cut a release for a new Dart Sass version commit: --allow-empty + build_linux_musl: + needs: [deploy_github_linux] + if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + uses: ./.github/workflows/build-linux-musl.yaml + secrets: inherit + + build_android: + needs: [deploy_github_linux] + if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + uses: ./.github/workflows/build-android.yaml + secrets: inherit + + deploy_github_linux_extra: + name: "Deploy Github: linux-musl, android" + runs-on: ubuntu-latest + needs: [build_linux_musl, build_android] + if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + + permissions: + contents: write + + steps: + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-linux-musl-x64 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-linux-musl-ia32 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-linux-musl-arm64 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-linux-musl-arm + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-android-x64 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-android-ia32 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-android-arm64 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: build-android-arm + + - name: Release + uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d + with: + files: | + *.tar.gz + release_embedded_host: name: "Release Embedded Host" runs-on: ubuntu-latest From c619b7f28e37270ffba5d8d7d2842fc37e373c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 11:04:35 -0800 Subject: [PATCH 02/18] Update to artifact@v4 --- .github/workflows/build-android.yaml | 3 ++- .github/workflows/build-linux-musl.yaml | 3 ++- .github/workflows/ci.yml | 16 ++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml index a696bf17f..472526d10 100644 --- a/.github/workflows/build-android.yaml +++ b/.github/workflows/build-android.yaml @@ -63,8 +63,9 @@ jobs: EOF - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-android-${{ matrix.arch }} path: build/*.tar.gz if-no-files-found: error + compression-level: 0 diff --git a/.github/workflows/build-linux-musl.yaml b/.github/workflows/build-linux-musl.yaml index 3e4d8f700..ace471021 100644 --- a/.github/workflows/build-linux-musl.yaml +++ b/.github/workflows/build-linux-musl.yaml @@ -81,8 +81,9 @@ jobs: EOF - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-linux-musl-${{ matrix.arch }} path: build/*.tar.gz if-no-files-found: error + compression-level: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 525fec0b0..5fc8cb2ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -635,42 +635,42 @@ jobs: steps: - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-linux-musl-x64 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-linux-musl-ia32 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-linux-musl-arm64 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-linux-musl-arm - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-android-x64 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-android-ia32 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-android-arm64 - name: Download Artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-android-arm From 21059288c4bd35a459f70a69106e5966542ddaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 11:28:23 -0800 Subject: [PATCH 03/18] Add token to github calls --- .github/workflows/build-android.yaml | 10 +++++----- .github/workflows/build-linux-musl.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml index 472526d10..5f2bb57db 100644 --- a/.github/workflows/build-android.yaml +++ b/.github/workflows/build-android.yaml @@ -38,11 +38,11 @@ jobs: - name: Compile Protobuf run: | docker run --rm -i \ - --volume $PWD:$PWD \ - --workdir $PWD \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ docker.io/library/dart <<'EOF' set -e - curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 + curl -fsSL -H "Authorization: Bearer ${{ github.token }}" "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 dart pub get dart run grinder protobuf EOF @@ -52,8 +52,8 @@ jobs: docker run --rm -i \ --platform ${{ matrix.platform }} \ --privileged \ - --volume $PWD:$PWD \ - --workdir $PWD \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ ghcr.io/dart-android/dart <<'EOF' set -e export DART_SDK=/system/${{ matrix.lib }}/dart diff --git a/.github/workflows/build-linux-musl.yaml b/.github/workflows/build-linux-musl.yaml index ace471021..a8d55b800 100644 --- a/.github/workflows/build-linux-musl.yaml +++ b/.github/workflows/build-linux-musl.yaml @@ -32,11 +32,11 @@ jobs: - name: Compile Protobuf run: | docker run --rm -i \ - --volume $PWD:$PWD \ - --workdir $PWD \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ docker.io/library/dart <<'EOF' set -e - curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 + curl -fsSL -H "Authorization: Bearer ${{ github.token }}" "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 dart pub get dart run grinder protobuf EOF @@ -51,8 +51,8 @@ jobs: run: | docker run --rm -i \ --platform ${{ matrix.arch == 'arm' && 'linux/amd64' || matrix.platform }} \ - --volume $PWD:$PWD \ - --workdir $PWD \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ ghcr.io/dart-musl/dart <<'EOF' set -e dart pub get From f51216e5cba3eb58e675d254e983c17df49c0d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 12:18:46 -0800 Subject: [PATCH 04/18] Split CI.yml into multiple files --- .../{build-android.yaml => build-android.yml} | 0 ...d-linux-musl.yaml => build-linux-musl.yml} | 0 .github/workflows/build-linux.yml | 62 ++ .github/workflows/build-macos.yml | 37 + .github/workflows/build-windows.yml | 38 + .github/workflows/ci.yml | 702 +----------------- .github/workflows/release.yml | 220 ++++++ .github/workflows/test-framework.yml | 72 ++ .github/workflows/test.yml | 305 ++++++++ 9 files changed, 743 insertions(+), 693 deletions(-) rename .github/workflows/{build-android.yaml => build-android.yml} (100%) rename .github/workflows/{build-linux-musl.yaml => build-linux-musl.yml} (100%) create mode 100644 .github/workflows/build-linux.yml create mode 100644 .github/workflows/build-macos.yml create mode 100644 .github/workflows/build-windows.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test-framework.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yml similarity index 100% rename from .github/workflows/build-android.yaml rename to .github/workflows/build-android.yml diff --git a/.github/workflows/build-linux-musl.yaml b/.github/workflows/build-linux-musl.yml similarity index 100% rename from .github/workflows/build-linux-musl.yaml rename to .github/workflows/build-linux-musl.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 000000000..e36628c4a --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,62 @@ +name: Build for linux + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + platform: linux/amd64 + - arch: ia32 + platform: linux/amd64 + - arch: arm + platform: linux/arm/v7 + - arch: arm64 + platform: linux/arm64 + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Compile Protobuf + run: | + docker run --rm -i \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ + docker.io/library/dart <<'EOF' + set -e + curl -fsSL -H "Authorization: Bearer ${{ github.token }}" "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 + dart pub get + dart run grinder protobuf + EOF + + - name: Build + run: | + docker run --rm -i \ + --platform ${{ matrix.platform }} \ + --volume "$PWD:$PWD" \ + --workdir "$PWD" \ + docker.io/library/dart:latest <<'EOF' + set -e + dart pub get + dart run grinder pkg-standalone-linux-${{ matrix.arch }} + EOF + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-linux-${{ matrix.arch }} + path: build/*.tar.gz + if-no-files-found: error + compression-level: 0 diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 000000000..fd9129996 --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,37 @@ +name: Build for macos + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + name: Build + + runs-on: ${{ matrix.runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + runner: macos-latest + # https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/ + - arch: arm64 + runner: macos-latest-xlarge + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/util/initialize + + - name: Build + run: dart run grinder pkg-standalone-macos-${{ matrix.arch }} + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-macos-${{ matrix.arch }} + path: build/*.tar.gz + if-no-files-found: error + compression-level: 0 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 000000000..127313ff1 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,38 @@ +name: Build for windows + +on: + workflow_call: + workflow_dispatch: + +jobs: + build: + name: Build + + runs-on: ${{ matrix.runner }} + + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + runner: windows-latest + - arch: ia32 + runner: windows-latest + # - arch: arm64 + # runner: windows-latest + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/util/initialize + + - name: Build + run: dart run grinder pkg-standalone-windows-${{ matrix.arch }} + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-windows-${{ matrix.arch }} + path: build/*.zip + if-no-files-found: error + compression-level: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fc8cb2ad..83d5e8271 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,5 @@ name: CI -defaults: - run: {shell: bash} - # The default Node version lives in ../util/initialize/action.yml. It should be # kept up-to-date with the latest Node LTS releases, along with the various # node-version matrices below. @@ -16,316 +13,14 @@ on: pull_request: jobs: - format: - name: Code formatting - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@v1 - - run: dart format --fix . - - run: git diff --exit-code - - static_analysis: - name: Static analysis - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Analyze Dart - run: dart analyze --fatal-warnings ./ - - dartdoc: - name: Dartdoc - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: dartdoc sass - run: dart run dartdoc --quiet --no-generate-docs - --errors ambiguous-doc-reference,broken-link,deprecated - --errors unknown-directive,unknown-macro,unresolved-doc-reference - - name: dartdoc sass_api - run: cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs - --errors ambiguous-doc-reference,broken-link,deprecated - --errors unknown-directive,unknown-macro,unresolved-doc-reference - - sass_spec_language: - name: "Language Tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}" - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - dart_channel: [stable, dev] - async_label: [synchronous] - async_args: [''] - include: - - dart_channel: stable - async_label: asynchronous - async_args: '--cmd-args --async' - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - - uses: ./.github/util/sass-spec - - - name: Run specs - run: npm run sass-spec -- --dart .. $extra_args - working-directory: sass-spec - env: {extra_args: "${{ matrix.async_args }}"} - - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated April 2021. See - # https://github.com/nodejs/Release. - sass_spec_js: - name: "JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - dart_channel: [stable] - node-version: [18] - include: - # Include LTS versions on Ubuntu - - os: ubuntu-latest - dart_channel: stable - node-version: 16 - - os: ubuntu-latest - dart_channel: stable - node-version: 14 - - os: ubuntu-latest - dart_channel: dev - node-version: 18 - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - node-version: ${{ matrix.node-version }} - - uses: ./.github/util/sass-spec - - - name: Build JS - run: dart run grinder pkg-npm-dev - - - name: Check out Sass specification - uses: sass/clone-linked-repo@v1 - with: - repo: sass/sass - path: language - - - name: Run tests - run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm - working-directory: sass-spec - - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated October 2021. See - # https://github.com/nodejs/Release. - sass_spec_js_embedded: - name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}' - runs-on: ${{ matrix.os }}-latest - if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')" - - strategy: - fail-fast: false - matrix: - os: [ubuntu, windows, macos] - node-version: [18] - include: - # Include LTS versions on Ubuntu - - os: ubuntu - node-version: 16 - - os: ubuntu - node-version: 14 - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: - github-token: ${{ github.token }} - node-version: ${{ matrix.node-version }} - - uses: ./.github/util/sass-spec - - - name: Check out the embedded host - uses: sass/clone-linked-repo@v1 - with: {repo: sass/embedded-host-node} - - - name: Check out the language repo - uses: sass/clone-linked-repo@v1 - with: {repo: sass/sass, path: build/language} - - - name: Initialize embedded host - run: | - npm install - npm run init -- --compiler-path=.. --language-path=../build/language - npm run compile - mv {`pwd`/,dist/}lib/src/vendor/dart-sass - working-directory: embedded-host-node - - - name: Version info - run: | - path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass - if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version - elif [[ -f "$path.bat" ]]; then "./$path.bat" --version - elif [[ -f "$path.exe" ]]; then "./$path.exe" --version - else "./$path" --version - fi - - - name: Run tests - run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../build/language - working-directory: sass-spec - - sass_spec_js_browser: - name: "JS API Tests | Browser | Dart ${{ matrix.dart_channel }}" - - strategy: - matrix: - dart_channel: [stable] - fail-fast: false - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: browser-actions/setup-chrome@v1 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - - uses: ./.github/util/sass-spec - - - name: Build JS - run: dart run grinder pkg-npm-dev - - - name: Install built dependencies - run: npm install - working-directory: build/npm - - - name: Check out Sass specification - uses: sass/clone-linked-repo@v1 - with: - repo: sass/sass - path: language - - - name: Run tests - run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm --browser - working-directory: sass-spec - env: - CHROME_EXECUTABLE: chrome - - dart_tests: - name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - dart_channel: [stable] - # TODO(nweiz): Re-enable this when - # https://github.com/dart-lang/sdk/issues/52121#issuecomment-1728534228 - # is addressed. - # include: [{os: ubuntu-latest, dart_channel: dev}] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - - - run: dart run grinder pkg-standalone-dev - - name: Run tests - run: dart run test -x node - - # Unit tests that use Node.js, defined in test/. - # - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated April 2021. See - # https://github.com/nodejs/Release. - node_tests: - name: "Node tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" - - strategy: - fail-fast: false - - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - dart_channel: [stable] - node-version: [18] - include: - # Include LTS versions on Ubuntu - - os: ubuntu-latest - dart_channel: stable - node-version: 16 - - os: ubuntu-latest - dart_channel: stable - node-version: 14 - - os: ubuntu-latest - dart_channel: dev - node-version: 18 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - node-version: ${{ matrix.node-version }} - - - run: dart run grinder pkg-npm-dev - - name: Run tests - run: dart run test -t node -j 2 - - browser_tests: - name: "Browser Tests | Dart ${{ matrix.dart_channel }}" - - strategy: - matrix: - dart_channel: [stable] - fail-fast: false - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: browser-actions/setup-chrome@v1 - - uses: ./.github/util/initialize - with: - dart-sdk: ${{ matrix.dart_channel }} - github-token: ${{ github.token }} - - - run: dart run grinder pkg-npm-dev - - name: Run tests - run: dart run test -p chrome -j 2 - env: - CHROME_EXECUTABLE: chrome + test: + uses: ./.github/workflows/test.yml + secrets: inherit double_check: name: Double-check runs-on: ubuntu-latest - needs: - - sass_spec_language - - sass_spec_js - - sass_spec_js_browser - - sass_spec_js_embedded - - dart_tests - - node_tests - - browser_tests - - static_analysis - - dartdoc - - format + needs: [test] if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" steps: @@ -336,393 +31,14 @@ jobs: - name: Run checks run: dart run grinder double-check-before-release - bootstrap: - name: "Bootstrap ${{ matrix.bootstrap_version }}" - runs-on: ubuntu-latest - needs: [double_check] - - strategy: - fail-fast: false - matrix: - bootstrap_version: [4, 5] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - run: dart run grinder fetch-bootstrap${{matrix.bootstrap_version}} - env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} - - name: Build - run: dart bin/sass.dart --quiet build/bootstrap/scss:build/bootstrap-output - - bourbon: - name: Bourbon - runs-on: ubuntu-latest - needs: [double_check] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - run: dart run grinder fetch-bourbon - env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} - - name: Test - run: | - dart bin/sass.dart --quiet -I build/bourbon -I build/bourbon/spec/fixtures \ - build/bourbon/spec/fixtures:build/bourbon-output - - foundation: - name: Foundation - runs-on: ubuntu-latest - needs: [double_check] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - run: dart run grinder fetch-foundation - env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} - # TODO(nweiz): Foundation has proper Sass tests, but they're currently not - # compatible with Dart Sass. Once they are, we should run those rather - # than just building the CSS output. - - name: Build - run: dart bin/sass.dart --quiet build/foundation-sites/assets:build/foundation-output - - bulma: - name: Bulma - runs-on: ubuntu-latest + test_framework: needs: [double_check] - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - run: dart run grinder fetch-bulma - env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} - - name: Build - run: dart bin/sass.dart --quiet build/bulma/bulma.sass build/bulma-output.css - - deploy_github_linux: - name: "Deploy Github: linux-ia32, linux-x64" - runs-on: ubuntu-latest - needs: [bootstrap, bourbon, foundation, bulma] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder pkg-github-release pkg-github-linux-ia32 pkg-github-linux-x64 - env: - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_github_linux_qemu: - name: "Deploy Github: linux-${{ matrix.arch }}" - runs-on: ubuntu-latest - strategy: - matrix: - include: - - arch: arm - platform: linux/arm/v7 - - arch: arm64 - platform: linux/arm64 - needs: [deploy_github_linux] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - uses: docker/setup-qemu-action@v3 - - name: Deploy - run: | - docker run --rm \ - --env "GH_TOKEN=$GH_TOKEN" \ - --env "GH_USER=$GH_USER" \ - --platform ${{ matrix.platform }} \ - --volume "$PWD:$PWD" \ - --workdir "$PWD" \ - docker.io/library/dart:latest \ - /bin/sh -c "dart pub get && dart run grinder pkg-github-linux-${{ matrix.arch }}" - env: - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_github: - name: "Deploy Github: ${{ matrix.platform }}" - runs-on: ${{ matrix.runner }} - needs: [deploy_github_linux] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - strategy: - matrix: - include: - - runner: macos-latest - platform: macos-x64 - architecture: x64 - # https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/ - - runner: macos-latest-xlarge - platform: macos-arm64 - architecture: arm64 - - runner: windows-latest - platform: windows - architecture: x64 - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - # Workaround for dart-lang/setup-dart#59 - with: - github-token: ${{ github.token }} - architecture: ${{ matrix.architecture }} - - - name: Deploy - run: dart run grinder pkg-github-${{ matrix.platform }} - env: - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_npm: - name: Deploy npm - runs-on: ubuntu-latest - needs: [bootstrap, bourbon, foundation, bulma] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder pkg-npm-deploy - env: - NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" - - deploy_bazel: - name: Deploy Bazel - runs-on: ubuntu-latest - needs: [deploy_npm] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder update-bazel - env: - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_pub: - name: "Deploy Pub" - runs-on: ubuntu-latest - needs: [bootstrap, bourbon, foundation, bulma] if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder protobuf pkg-pub-deploy - env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"} - - deploy_sub_packages: - name: "Deploy Sub-Packages" - runs-on: ubuntu-latest - needs: [deploy_pub] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder deploy-sub-packages - env: - PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}" - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_homebrew: - name: "Deploy Homebrew" - runs-on: ubuntu-latest - needs: [bootstrap, bourbon, foundation, bulma] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@v1 - - run: dart pub get - - - name: Deploy - run: dart run grinder pkg-homebrew-update - env: - GH_TOKEN: "${{ secrets.GH_TOKEN }}" - GH_USER: sassbot - - deploy_chocolatey: - name: "Deploy Chocolatey" - runs-on: windows-latest - needs: [bootstrap, bourbon, foundation, bulma] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/util/initialize - with: {github-token: "${{ github.token }}"} - - - name: Deploy - run: dart run grinder pkg-chocolatey-deploy - env: {CHOCOLATEY_TOKEN: "${{ secrets.CHOCOLATEY_TOKEN }}"} - - deploy_website: - name: "Deploy sass-lang.com" - runs-on: ubuntu-latest - needs: [deploy_npm] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - steps: - - uses: actions/checkout@v4 - with: - repository: sass/sass-site - token: ${{ secrets.SASS_SITE_TOKEN }} - - - name: Get version - id: version - run: echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT" - - - name: Update Dart Sass version - run: npm install sass@${{ steps.version.outputs.version }} - - - uses: EndBug/add-and-commit@v9 - with: - author_name: Sass Bot - author_email: sass.bot.beep.boop@gmail.com - message: Cut a release for a new Dart Sass version - commit: --allow-empty - - build_linux_musl: - needs: [deploy_github_linux] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - uses: ./.github/workflows/build-linux-musl.yaml + uses: ./.github/workflows/test-framework.yml secrets: inherit - build_android: - needs: [deploy_github_linux] + release: + needs: [test_framework] if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - uses: ./.github/workflows/build-android.yaml + uses: ./.github/workflows/release.yml secrets: inherit - - deploy_github_linux_extra: - name: "Deploy Github: linux-musl, android" - runs-on: ubuntu-latest - needs: [build_linux_musl, build_android] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - - permissions: - contents: write - - steps: - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-linux-musl-x64 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-linux-musl-ia32 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-linux-musl-arm64 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-linux-musl-arm - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-android-x64 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-android-ia32 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-android-arm64 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: build-android-arm - - - name: Release - uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d - with: - files: | - *.tar.gz - - release_embedded_host: - name: "Release Embedded Host" - runs-on: ubuntu-latest - needs: [deploy_github_linux, deploy_github_linux_qemu, deploy_github] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" - steps: - - uses: actions/checkout@v4 - with: - repository: sass/embedded-host-node - token: ${{ secrets.GH_TOKEN }} - - - name: Get version - id: version - run: | - echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT" - echo "protocol_version=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/sass/HEAD/spec/EMBEDDED_PROTOCOL_VERSION)" | tee --append "$GITHUB_OUTPUT" - - - name: Update version - run: | - # Update binary package versions - for dir in $(ls npm); do - cat "npm/$dir/package.json" | - jq --arg version ${{ steps.version.outputs.version }} ' - .version |= $version - ' > package.json.tmp && - mv package.json.tmp "npm/$dir/package.json" - done - - # Update main package version and dependencies on binary packages - cat package.json | - jq --arg version ${{ steps.version.outputs.version }} --arg protocol_version ${{ steps.version.outputs.protocol_version }} ' - .version |= $version | - ."compiler-version" |= $version | - ."protocol-version" |= $protocol_version | - .optionalDependencies = (.optionalDependencies | .[] |= $version) - ' > package.json.tmp && - mv package.json.tmp package.json - curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md - shell: bash - - - uses: EndBug/add-and-commit@v9 - with: - author_name: Sass Bot - author_email: sass.bot.beep.boop@gmail.com - message: Update Dart Sass version and release - tag: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..f00baf0fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,220 @@ +name: Release + +on: + workflow_call: + +jobs: + build_android: + uses: ./.github/workflows/build-android.yml + secrets: inherit + + build_linux: + uses: ./.github/workflows/build-linux.yml + secrets: inherit + + build_linux_musl: + uses: ./.github/workflows/build-linux-musl.yml + secrets: inherit + + build_macos: + uses: ./.github/workflows/build-macos.yml + secrets: inherit + + build_windows: + uses: ./.github/workflows/build-windows.yml + secrets: inherit + + release_github: + name: Release Github + runs-on: ubuntu-latest + needs: [build_android, build_linux, build_linux_musl, build_macos, build_windows] + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder pkg-github-release + env: + GH_TOKEN: "${{ secrets.GH_TOKEN }}" + GH_USER: sassbot + + deploy_github: + name: Deploy Github + runs-on: ubuntu-latest + needs: [release_github] + + permissions: + contents: write + + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + dart-sass-*.tar.gz + dart-sass-*.zip + + deploy_npm: + name: Deploy npm + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder pkg-npm-deploy + env: + NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" + + deploy_bazel: + name: Deploy Bazel + runs-on: ubuntu-latest + needs: [deploy_npm] + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder update-bazel + env: + GH_TOKEN: "${{ secrets.GH_TOKEN }}" + GH_USER: sassbot + + deploy_pub: + name: Deploy Pub + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder protobuf pkg-pub-deploy + env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"} + + deploy_sub_packages: + name: Deploy Sub-Packages + runs-on: ubuntu-latest + needs: [deploy_pub] + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder deploy-sub-packages + env: + PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}" + GH_TOKEN: "${{ secrets.GH_TOKEN }}" + GH_USER: sassbot + + deploy_homebrew: + name: Deploy Homebrew + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + - run: dart pub get + + - name: Deploy + run: dart run grinder pkg-homebrew-update + env: + GH_TOKEN: "${{ secrets.GH_TOKEN }}" + GH_USER: sassbot + + deploy_chocolatey: + name: Deploy Chocolatey + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Deploy + run: dart run grinder pkg-chocolatey-deploy + env: {CHOCOLATEY_TOKEN: "${{ secrets.CHOCOLATEY_TOKEN }}"} + + deploy_website: + name: Deploy sass-lang.com + runs-on: ubuntu-latest + needs: [deploy_npm] + + steps: + - uses: actions/checkout@v4 + with: + repository: sass/sass-site + token: ${{ secrets.SASS_SITE_TOKEN }} + + - name: Get version + id: version + run: echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT" + + - name: Update Dart Sass version + run: npm install sass@${{ steps.version.outputs.version }} + + - uses: EndBug/add-and-commit@v9 + with: + author_name: Sass Bot + author_email: sass.bot.beep.boop@gmail.com + message: Cut a release for a new Dart Sass version + commit: --allow-empty + + release_embedded_host: + name: Release Embedded Host + runs-on: ubuntu-latest + needs: [deploy_github] + + steps: + - uses: actions/checkout@v4 + with: + repository: sass/embedded-host-node + token: ${{ secrets.GH_TOKEN }} + + - name: Get version + id: version + run: | + echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT" + echo "protocol_version=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/sass/HEAD/spec/EMBEDDED_PROTOCOL_VERSION)" | tee --append "$GITHUB_OUTPUT" + + - name: Update version + run: | + # Update binary package versions + for dir in $(ls npm); do + cat "npm/$dir/package.json" | + jq --arg version ${{ steps.version.outputs.version }} ' + .version |= $version + ' > package.json.tmp && + mv package.json.tmp "npm/$dir/package.json" + done + + # Update main package version and dependencies on binary packages + cat package.json | + jq --arg version ${{ steps.version.outputs.version }} --arg protocol_version ${{ steps.version.outputs.protocol_version }} ' + .version |= $version | + ."compiler-version" |= $version | + ."protocol-version" |= $protocol_version | + .optionalDependencies = (.optionalDependencies | .[] |= $version) + ' > package.json.tmp && + mv package.json.tmp package.json + curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md + shell: bash + + - uses: EndBug/add-and-commit@v9 + with: + author_name: Sass Bot + author_email: sass.bot.beep.boop@gmail.com + message: Update Dart Sass version and release + tag: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/test-framework.yml b/.github/workflows/test-framework.yml new file mode 100644 index 000000000..9a635b330 --- /dev/null +++ b/.github/workflows/test-framework.yml @@ -0,0 +1,72 @@ +name: Test Framework + +on: + workflow_call: + workflow_dispatch: + +jobs: + bootstrap: + name: "Bootstrap ${{ matrix.bootstrap_version }}" + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + bootstrap_version: [4, 5] + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - run: dart run grinder fetch-bootstrap${{matrix.bootstrap_version}} + env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} + - name: Build + run: dart bin/sass.dart --quiet build/bootstrap/scss:build/bootstrap-output + + bourbon: + name: Bourbon + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - run: dart run grinder fetch-bourbon + env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} + - name: Test + run: | + dart bin/sass.dart --quiet -I build/bourbon -I build/bourbon/spec/fixtures \ + build/bourbon/spec/fixtures:build/bourbon-output + + foundation: + name: Foundation + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - run: dart run grinder fetch-foundation + env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} + # TODO(nweiz): Foundation has proper Sass tests, but they're currently not + # compatible with Dart Sass. Once they are, we should run those rather + # than just building the CSS output. + - name: Build + run: dart bin/sass.dart --quiet build/foundation-sites/assets:build/foundation-output + + bulma: + name: Bulma + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - run: dart run grinder fetch-bulma + env: {GITHUB_BEARER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"} + - name: Build + run: dart bin/sass.dart --quiet build/bulma/bulma.sass build/bulma-output.css diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..87acccb83 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,305 @@ +name: Test Framework + +defaults: + run: {shell: bash} + +on: + workflow_call: + workflow_dispatch: + +jobs: + format: + name: Code formatting + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + - run: dart format --fix . + - run: git diff --exit-code + + static_analysis: + name: Static analysis + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: Analyze Dart + run: dart analyze --fatal-warnings ./ + + dartdoc: + name: Dartdoc + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} + + - name: dartdoc sass + run: dart run dartdoc --quiet --no-generate-docs + --errors ambiguous-doc-reference,broken-link,deprecated + --errors unknown-directive,unknown-macro,unresolved-doc-reference + - name: dartdoc sass_api + run: cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs + --errors ambiguous-doc-reference,broken-link,deprecated + --errors unknown-directive,unknown-macro,unresolved-doc-reference + + sass_spec_language: + name: "Language Tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}" + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + dart_channel: [stable, dev] + async_label: [synchronous] + async_args: [''] + include: + - dart_channel: stable + async_label: asynchronous + async_args: '--cmd-args --async' + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + - uses: ./.github/util/sass-spec + + - name: Run specs + run: npm run sass-spec -- --dart .. $extra_args + working-directory: sass-spec + env: {extra_args: "${{ matrix.async_args }}"} + + # The versions should be kept up-to-date with the latest LTS Node releases. + # They next need to be rotated April 2021. See + # https://github.com/nodejs/Release. + sass_spec_js: + name: "JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dart_channel: [stable] + node-version: [18] + include: + # Include LTS versions on Ubuntu + - os: ubuntu-latest + dart_channel: stable + node-version: 16 + - os: ubuntu-latest + dart_channel: stable + node-version: 14 + - os: ubuntu-latest + dart_channel: dev + node-version: 18 + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + node-version: ${{ matrix.node-version }} + - uses: ./.github/util/sass-spec + + - name: Build JS + run: dart run grinder pkg-npm-dev + + - name: Check out Sass specification + uses: sass/clone-linked-repo@v1 + with: + repo: sass/sass + path: language + + - name: Run tests + run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm + working-directory: sass-spec + + # The versions should be kept up-to-date with the latest LTS Node releases. + # They next need to be rotated October 2021. See + # https://github.com/nodejs/Release. + sass_spec_js_embedded: + name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}' + runs-on: ${{ matrix.os }}-latest + if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')" + + strategy: + fail-fast: false + matrix: + os: [ubuntu, windows, macos] + node-version: [18] + include: + # Include LTS versions on Ubuntu + - os: ubuntu + node-version: 16 + - os: ubuntu + node-version: 14 + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: + github-token: ${{ github.token }} + node-version: ${{ matrix.node-version }} + - uses: ./.github/util/sass-spec + + - name: Check out the embedded host + uses: sass/clone-linked-repo@v1 + with: {repo: sass/embedded-host-node} + + - name: Check out the language repo + uses: sass/clone-linked-repo@v1 + with: {repo: sass/sass, path: build/language} + + - name: Initialize embedded host + run: | + npm install + npm run init -- --compiler-path=.. --language-path=../build/language + npm run compile + mv {`pwd`/,dist/}lib/src/vendor/dart-sass + working-directory: embedded-host-node + + - name: Version info + run: | + path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass + if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version + elif [[ -f "$path.bat" ]]; then "./$path.bat" --version + elif [[ -f "$path.exe" ]]; then "./$path.exe" --version + else "./$path" --version + fi + + - name: Run tests + run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../build/language + working-directory: sass-spec + + sass_spec_js_browser: + name: "JS API Tests | Browser | Dart ${{ matrix.dart_channel }}" + + strategy: + matrix: + dart_channel: [stable] + fail-fast: false + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: browser-actions/setup-chrome@v1 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + - uses: ./.github/util/sass-spec + + - name: Build JS + run: dart run grinder pkg-npm-dev + + - name: Install built dependencies + run: npm install + working-directory: build/npm + + - name: Check out Sass specification + uses: sass/clone-linked-repo@v1 + with: + repo: sass/sass + path: language + + - name: Run tests + run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm --browser + working-directory: sass-spec + env: + CHROME_EXECUTABLE: chrome + + dart_tests: + name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dart_channel: [stable] + # TODO(nweiz): Re-enable this when + # https://github.com/dart-lang/sdk/issues/52121#issuecomment-1728534228 + # is addressed. + # include: [{os: ubuntu-latest, dart_channel: dev}] + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + + - run: dart run grinder pkg-standalone-dev + - name: Run tests + run: dart run test -x node + + # Unit tests that use Node.js, defined in test/. + # + # The versions should be kept up-to-date with the latest LTS Node releases. + # They next need to be rotated April 2021. See + # https://github.com/nodejs/Release. + node_tests: + name: "Node tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + fail-fast: false + + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dart_channel: [stable] + node-version: [18] + include: + # Include LTS versions on Ubuntu + - os: ubuntu-latest + dart_channel: stable + node-version: 16 + - os: ubuntu-latest + dart_channel: stable + node-version: 14 + - os: ubuntu-latest + dart_channel: dev + node-version: 18 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + node-version: ${{ matrix.node-version }} + + - run: dart run grinder pkg-npm-dev + - name: Run tests + run: dart run test -t node -j 2 + + browser_tests: + name: "Browser Tests | Dart ${{ matrix.dart_channel }}" + + strategy: + matrix: + dart_channel: [stable] + fail-fast: false + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: browser-actions/setup-chrome@v1 + - uses: ./.github/util/initialize + with: + dart-sdk: ${{ matrix.dart_channel }} + github-token: ${{ github.token }} + + - run: dart run grinder pkg-npm-dev + - name: Run tests + run: dart run test -p chrome -j 2 + env: + CHROME_EXECUTABLE: chrome From 7e8dbf0bdcca4fea0acb1f9089d0ef271f0773dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 12:37:10 -0800 Subject: [PATCH 05/18] Check github.event.repository.fork == false --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83d5e8271..219575113 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: name: Double-check runs-on: ubuntu-latest needs: [test] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" steps: - uses: actions/checkout@v4 @@ -33,12 +33,12 @@ jobs: test_framework: needs: [double_check] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" uses: ./.github/workflows/test-framework.yml secrets: inherit release: needs: [test_framework] - if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" + if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" uses: ./.github/workflows/release.yml secrets: inherit From d172ec72b2486520819673c1af947177c0157ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 12:45:14 -0800 Subject: [PATCH 06/18] Add missing permission --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 219575113..1239ef013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,5 +40,7 @@ jobs: release: needs: [test_framework] if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" + permissions: + contents: write uses: ./.github/workflows/release.yml secrets: inherit From 561758268f3132f8ff1f24f4b654ce7f6176ecfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 13:48:29 -0800 Subject: [PATCH 07/18] Add missing tokens --- .github/workflows/build-macos.yml | 1 + .github/workflows/build-windows.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index fd9129996..7d31257bc 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -24,6 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} - name: Build run: dart run grinder pkg-standalone-macos-${{ matrix.arch }} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 127313ff1..d4828089a 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -25,6 +25,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} - name: Build run: dart run grinder pkg-standalone-windows-${{ matrix.arch }} From afdca550a4824369bc78310d4547119c04f95126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 14:39:46 -0800 Subject: [PATCH 08/18] Rename test-framework to test-vendor --- .github/workflows/ci.yml | 6 +++--- .github/workflows/{test-framework.yml => test-vendor.yml} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{test-framework.yml => test-vendor.yml} (99%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1239ef013..6113970ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,14 +31,14 @@ jobs: - name: Run checks run: dart run grinder double-check-before-release - test_framework: + test_vendor: needs: [double_check] if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" - uses: ./.github/workflows/test-framework.yml + uses: ./.github/workflows/test-vendor.yml secrets: inherit release: - needs: [test_framework] + needs: [test_vendor] if: "startsWith(github.ref, 'refs/tags/') && github.event.repository.fork == false" permissions: contents: write diff --git a/.github/workflows/test-framework.yml b/.github/workflows/test-vendor.yml similarity index 99% rename from .github/workflows/test-framework.yml rename to .github/workflows/test-vendor.yml index 9a635b330..e2d51825e 100644 --- a/.github/workflows/test-framework.yml +++ b/.github/workflows/test-vendor.yml @@ -1,4 +1,4 @@ -name: Test Framework +name: Test Vendor on: workflow_call: From 0e35471e262d3eab88691b2b815b04d4842adfdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 14:44:17 -0800 Subject: [PATCH 09/18] Update CI job name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87acccb83..860b3debc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test Framework +name: Test defaults: run: {shell: bash} From ad9bb5469b8cad98124649d75ba13b5cb91eee3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 15:07:38 -0800 Subject: [PATCH 10/18] Move a comment --- .github/workflows/ci.yml | 6 ------ .github/workflows/test.yml | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6113970ad..cabc84e11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,5 @@ name: CI -# The default Node version lives in ../util/initialize/action.yml. It should be -# kept up-to-date with the latest Node LTS releases, along with the various -# node-version matrices below. -# -# Next update: April 2021 - on: push: branches: [main, feature.*] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 860b3debc..0bcbe8d4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,11 @@ name: Test +# The default Node version lives in ../util/initialize/action.yml. It should be +# kept up-to-date with the latest Node LTS releases, along with the various +# node-version matrices below. +# +# Next update: April 2021 + defaults: run: {shell: bash} From 0153af217c62caadf414e4b69b8ef28c153107f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 15:10:45 -0800 Subject: [PATCH 11/18] Correct artifact pattern --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f00baf0fb..43d32c0e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,8 +56,7 @@ jobs: uses: softprops/action-gh-release@v1 with: files: | - dart-sass-*.tar.gz - dart-sass-*.zip + build-*/* deploy_npm: name: Deploy npm From 9a789e517d99a2b2aa29da307ec74d8842b4f26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 15:20:36 -0800 Subject: [PATCH 12/18] Use lts/* and lts/-n syntax for node version --- .github/util/initialize/action.yml | 2 +- .github/workflows/test.yml | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index ad2abda5e..30252d356 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -2,7 +2,7 @@ name: Initialize description: Check out Dart Sass and build the embedded protocol buffer. inputs: github-token: {required: true} - node-version: {required: false, default: 18} + node-version: {required: false, default: 'lts/*'} dart-sdk: {required: false, default: stable} architecture: {required: false} runs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bcbe8d4a..349595e80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,11 +1,5 @@ name: Test -# The default Node version lives in ../util/initialize/action.yml. It should be -# kept up-to-date with the latest Node LTS releases, along with the various -# node-version matrices below. -# -# Next update: April 2021 - defaults: run: {shell: bash} @@ -82,9 +76,6 @@ jobs: working-directory: sass-spec env: {extra_args: "${{ matrix.async_args }}"} - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated April 2021. See - # https://github.com/nodejs/Release. sass_spec_js: name: "JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" runs-on: "${{ matrix.os }}" @@ -94,18 +85,22 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] dart_channel: [stable] - node-version: [18] + node-version: ['lts/*'] include: - # Include LTS versions on Ubuntu + # Test older LTS versions - os: ubuntu-latest dart_channel: stable - node-version: 16 + node-version: lts/-3 - os: ubuntu-latest dart_channel: stable - node-version: 14 + node-version: lts/-2 + - os: ubuntu-latest + dart_channel: stable + node-version: lts/-1 + # Test LTS version with dart dev channel - os: ubuntu-latest dart_channel: dev - node-version: 18 + node-version: 'lts/*' steps: - uses: actions/checkout@v4 From 9463b381b954a455af403b0b976371671be8692a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 15:47:05 -0800 Subject: [PATCH 13/18] Reorder --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 349595e80..ccf3b9f6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,13 +90,13 @@ jobs: # Test older LTS versions - os: ubuntu-latest dart_channel: stable - node-version: lts/-3 + node-version: lts/-1 - os: ubuntu-latest dart_channel: stable node-version: lts/-2 - os: ubuntu-latest dart_channel: stable - node-version: lts/-1 + node-version: lts/-3 # Test LTS version with dart dev channel - os: ubuntu-latest dart_channel: dev From 502892fc6bf633822867f81c24bdc5c413a9205d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 16:03:57 -0800 Subject: [PATCH 14/18] Use lts/* everywhere --- .github/workflows/test.yml | 39 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ccf3b9f6c..302cb12b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,9 +124,6 @@ jobs: run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm working-directory: sass-spec - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated October 2021. See - # https://github.com/nodejs/Release. sass_spec_js_embedded: name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}' runs-on: ${{ matrix.os }}-latest @@ -136,13 +133,18 @@ jobs: fail-fast: false matrix: os: [ubuntu, windows, macos] - node-version: [18] + node-version: ['lts/*'] include: - # Include LTS versions on Ubuntu - - os: ubuntu - node-version: 16 - - os: ubuntu - node-version: 14 + # Test older LTS versions + - os: ubuntu-latest + dart_channel: stable + node-version: lts/-1 + - os: ubuntu-latest + dart_channel: stable + node-version: lts/-2 + - os: ubuntu-latest + dart_channel: stable + node-version: lts/-3 steps: - uses: actions/checkout@v4 @@ -244,10 +246,6 @@ jobs: run: dart run test -x node # Unit tests that use Node.js, defined in test/. - # - # The versions should be kept up-to-date with the latest LTS Node releases. - # They next need to be rotated April 2021. See - # https://github.com/nodejs/Release. node_tests: name: "Node tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}" runs-on: "${{ matrix.os }}" @@ -258,18 +256,23 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] dart_channel: [stable] - node-version: [18] + node-version: ['lts/*'] include: - # Include LTS versions on Ubuntu + # Test older LTS versions + - os: ubuntu-latest + dart_channel: stable + node-version: lts/-1 - os: ubuntu-latest dart_channel: stable - node-version: 16 + node-version: lts/-2 - os: ubuntu-latest dart_channel: stable - node-version: 14 + node-version: lts/-3 + # Test LTS version with dart dev channel - os: ubuntu-latest dart_channel: dev - node-version: 18 + node-version: 'lts/*' + steps: - uses: actions/checkout@v4 - uses: ./.github/util/initialize From 94189317e1483979ee4ce58627a510c9839c1b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 16:27:41 -0800 Subject: [PATCH 15/18] Fix os label --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 302cb12b4..aa31b610e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,13 +126,13 @@ jobs: sass_spec_js_embedded: name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}' - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')" strategy: fail-fast: false matrix: - os: [ubuntu, windows, macos] + os: [ubuntu-latest, windows-latest, macos-latest] node-version: ['lts/*'] include: # Test older LTS versions From 954406414d6a3cd662b64718ad4056c79fa5ae57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 17:52:31 -0800 Subject: [PATCH 16/18] Apply suggestions from code review Co-authored-by: Natalie Weizenbaum --- .github/workflows/build-linux-musl.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux-musl.yml b/.github/workflows/build-linux-musl.yml index a8d55b800..294290360 100644 --- a/.github/workflows/build-linux-musl.yml +++ b/.github/workflows/build-linux-musl.yml @@ -43,7 +43,7 @@ jobs: # There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm. # Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot - # for arm on CI. So, we create an kernel snapshot for arm build in amd64 container instead. + # for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead. # # In addition, we need to rename the artifact from -linux- to -linux-musl- to avoid conflict # with glibc builds. @@ -61,7 +61,7 @@ jobs: EOF # The kernel snapshot created for arm in the previous step is bundling a glibc based dart runtime - # due to how cli_pkg download the sdk for building non-native platforms. Therefore we need to + # due to how cli_pkg downloads the sdk for building non-native platforms. Therefore we need to # replace it with musl-libc based dart runtime to create a working linux-musl-arm package. - name: Fix Dart Runtime if: matrix.arch == 'arm' From e21b24a693aa51728b6819f5043e5db36ba6fde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 14 Dec 2023 18:02:53 -0800 Subject: [PATCH 17/18] Update comments --- .github/workflows/build-linux-musl.yml | 6 +++--- .github/workflows/build-windows.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux-musl.yml b/.github/workflows/build-linux-musl.yml index 294290360..050292f4a 100644 --- a/.github/workflows/build-linux-musl.yml +++ b/.github/workflows/build-linux-musl.yml @@ -41,12 +41,11 @@ jobs: dart run grinder protobuf EOF + # https://gitlab.com/qemu-project/qemu/-/issues/1729 + # # There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm. # Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot # for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead. - # - # In addition, we need to rename the artifact from -linux- to -linux-musl- to avoid conflict - # with glibc builds. - name: Build run: | docker run --rm -i \ @@ -57,6 +56,7 @@ jobs: set -e dart pub get dart run grinder pkg-standalone-linux-${{ matrix.arch }} + # Rename the artifact from -linux- to -linux-musl- to avoid conflict with glibc builds. find build -name '*.tar.gz' -print0 | xargs -0 -n 1 -- sh -xc 'mv "$1" "$(echo "$1" | sed -e "s/linux/linux-musl/")"' -- EOF diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d4828089a..7036dfa34 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -18,6 +18,8 @@ jobs: runner: windows-latest - arch: ia32 runner: windows-latest + # The support of windows-arm64 dart-sdk is in beta. + # TODO: Enable this once windows-arm64 support is stable. # - arch: arm64 # runner: windows-latest From ea053e7d71ba5756d576cc696804eac6bba32006 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 15 Dec 2023 14:17:13 -0800 Subject: [PATCH 18/18] Add a CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4995a0cb..5f520294c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ points that aren't in the US-ASCII region. Previously only code points U+0100 LATIN CAPITAL LETTER A WITH MACRON were escaped. +* Provide official releases for musl LibC and for Android. + ### JS API * Fix a bug where certain exceptions could produce `SourceSpan`s that didn't