Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Cleanup CI #7787

Merged
merged 17 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 25 additions & 46 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 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: 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: Check dependencies
# run: |
# ./scripts/crev/verify.sh

cargo-deny:
name: Check license of dependencies
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -688,16 +666,17 @@ 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"
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 }}
Expand Down
11 changes: 0 additions & 11 deletions scripts/github/create-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions scripts/github/run-cargo-hack.sh
Original file line number Diff line number Diff line change
@@ -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'"
$line
done <<< "$check_commands"
fi
File renamed without changes.
Loading