chore(ci): Cleanup CI (#7787)

**Description**:
 - Disable `crev` action.
 - Cleanup compilation check matrix.
 - Update `cargo-hack`.
This commit is contained in:
Donny/강동윤 2023-08-09 17:35:36 +09:00 committed by GitHub
parent 1c2eb88a60
commit ab39f1c3c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 58 deletions

View File

@ -75,21 +75,21 @@ jobs:
git config --global user.name 'SWC bot'
git config --global user.email 'bot@swc.rs'
- name: Install cargo-crev
uses: baptiste0928/cargo-install@v1.1.0
with:
crate: cargo-crev
version: "=0.23.5"
locked: true
# - name: Install cargo-crev
# uses: baptiste0928/cargo-install@v2
# with:
# crate: cargo-crev
# version: "=0.24.3"
# # locked: true
- name: Configure cargo-crev
run: |
cargo crev trust --level high https://github.com/kdy1/crev-proofs
cargo crev repo fetch all
# - name: Configure cargo-crev
# run: |
# cargo crev trust --level high https://github.com/kdy1/crev-proofs
# cargo crev repo fetch all
- name: Check dependencies
run: |
./scripts/crev/verify.sh
# - name: Check dependencies
# run: |
# ./scripts/crev/verify.sh
cargo-deny:
name: Check license of dependencies
@ -105,7 +105,7 @@ jobs:
profile: minimal
- name: Install cargo-deny
uses: baptiste0928/cargo-install@v1.1.0
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-deny
version: "0.11.3"
@ -232,8 +232,6 @@ jobs:
- crate: swc
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps --exclude-features debug --exclude-features plugin --exclude-features plugin_transform_schema_v1 --exclude-features plugin_transform_schema_vtest --exclude-features plugin_transform_host_js --exclude-features plugin_transform_host_native
- crate: swc
os: windows-latest
runner: windows-latest
@ -243,16 +241,12 @@ jobs:
- crate: swc_bundler
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_cached
os: ubuntu-latest
runner: ubuntu-latest
- crate: swc_common
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps --exclude-features plugin_transform_schema_vtest --exclude-features __plugin --exclude-features __plugin_mode --exclude-features __plugin_rt --exclude-features __rkyv --exclude-features rkyv-impl
- crate: swc_common
os: windows-latest
runner: windows-latest
@ -310,8 +304,6 @@ jobs:
- crate: swc_ecma_ast
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps --exclude-features __rkyv
- crate: swc_ecma_codegen
os: ubuntu-latest
runner: ubuntu-latest
@ -333,8 +325,6 @@ jobs:
- crate: swc_ecma_loader
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_loader
os: windows-latest
runner: windows-latest
@ -365,21 +355,15 @@ jobs:
- crate: swc_ecma_transforms
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_transforms_base
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_transforms_classes
os: ubuntu-latest
runner: ubuntu-latest
- crate: swc_ecma_transforms_compat
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_transforms_macros
os: ubuntu-latest
runner: ubuntu-latest
@ -392,8 +376,6 @@ jobs:
- crate: swc_ecma_transforms_optimization
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_transforms_proposal
os: ubuntu-latest
runner: ubuntu-latest
@ -409,16 +391,15 @@ jobs:
- crate: swc_ecma_transforms_typescript
os: ubuntu-latest
runner: ubuntu-latest
- crate: swc_ecma_usage_analyzer
os: ubuntu-latest
runner: ubuntu-latest
- crate: swc_ecma_utils
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecma_visit
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo hack check --feature-powerset --no-dev-deps
- crate: swc_ecmascript
os: ubuntu-latest
runner: ubuntu-latest
@ -479,9 +460,6 @@ jobs:
- crate: swc_node_bundler
os: ubuntu-latest
runner: ubuntu-latest
check: |
cargo check
cargo check --no-default-features --features swc_v2
- crate: swc_node_bundler
os: windows-latest
runner: windows-latest
@ -677,7 +655,7 @@ jobs:
env:
SWC_FORCE_CONCURRENT: "1"
run: |
./scripts/ci/test-concurrent.sh ${{ matrix.settings.crate }}
./scripts/github/test-concurrent.sh ${{ matrix.settings.crate }}
- name: Run cargo test (swc, concurrent)
shell: bash
@ -688,16 +666,16 @@ jobs:
cargo test -p swc --features concurrent
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v1.1.0
if: matrix.settings.os == 'ubuntu-latest' && matrix.settings.check
uses: baptiste0928/cargo-install@v2
if: matrix.settings.os == 'ubuntu-latest'
with:
crate: cargo-hack
version: "0.5.7"
version: "0.5.29"
locked: true
- name: Check compilation
if: matrix.settings.check
working-directory: "crates/${{ matrix.settings.crate }}"
run: "${{ matrix.settings.check }}"
run: |
./scripts/github/run-cargo-hack.sh ${{ matrix.settings.crate }}
node-test:
name: Test node bindings - ${{ matrix.os }}

View File

@ -27,17 +27,6 @@ do
echo " runner: ubuntu-latest"
fi
if echo $json_str | jq -e ".check.\"$crate\"" > /dev/null; then
echo " check: |"
check_commands=$(echo $json_str | jq -e -r ".check.\"$crate\" | .[]")
while IFS= read -r line; do
echo " $line"
done <<< "$check_commands"
fi
if echo $json_str | jq -e "select(.os.macos | index(\"$crate\"))" > /dev/null; then
echo "- crate: $crate"
echo " os: macos-latest"

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -eu
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
crate=$1
echo "Running cargo hack for crate $crate"
# yq query syntax is weird, so we have to use jq
json_str="$(yq -o=json $SCRIPT_DIR/tests.yml)"
if echo $json_str | jq -e ".check.\"$crate\"" > /dev/null; then
check_commands=$(echo $json_str | jq -e -r ".check.\"$crate\" | .[]")
while IFS= read -r line; do
echo " Running '$line'"
(cd "crates/$crate" && $line)
done <<< "$check_commands"
fi

View File

@ -26,7 +26,7 @@ os:
check:
swc:
# plugin feature is verified by other tasks
- "cargo hack check --feature-powerset --no-dev-deps --exclude-features debug --exclude-features plugin --exclude-features plugin_transform_schema_v1 --exclude-features plugin_transform_schema_vtest"
- "cargo hack check --feature-powerset --no-dev-deps --exclude-features debug --exclude-features plugin --exclude-features plugin_transform_schema_v1 --exclude-features plugin_transform_schema_vtest --exclude-features plugin_transform_host_js"
swc_bundler:
- "cargo hack check --feature-powerset --no-dev-deps"
swc_common: