|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + rust: |
| 7 | + name: deno_core-${{ matrix.os }} |
| 8 | + if: | |
| 9 | + (github.event_name == 'push' || !startsWith(github.event.pull_request.head.label, 'denoland:')) |
| 10 | + && github.ref_name != 'deno_core' |
| 11 | + && !startsWith(github.ref, 'refs/tags/deno/') |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + timeout-minutes: 30 |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [macOS-latest, ubuntu-latest, windows-2019] |
| 17 | + |
| 18 | + env: |
| 19 | + CARGO_INCREMENTAL: 0 |
| 20 | + GH_ACTIONS: 1 |
| 21 | + RUST_BACKTRACE: full |
| 22 | + RUSTFLAGS: -D warnings |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Clone repository |
| 26 | + uses: actions/checkout@v3 |
| 27 | + |
| 28 | + - name: Install Rust |
| 29 | + uses: dsherret/rust-toolchain-file@v1 |
| 30 | + |
| 31 | + - name: Install Deno |
| 32 | + uses: denoland/setup-deno@v1 |
| 33 | + |
| 34 | + - name: Format |
| 35 | + if: contains(matrix.os, 'ubuntu') |
| 36 | + run: | |
| 37 | + cargo fmt -- --check |
| 38 | + deno fmt --check |
| 39 | +
|
| 40 | + - name: Lint |
| 41 | + if: contains(matrix.os, 'ubuntu') |
| 42 | + run: | |
| 43 | + cargo clippy --locked --release --all-features --all-targets -- -D clippy::all |
| 44 | + deno lint |
| 45 | +
|
| 46 | + - name: Cargo build |
| 47 | + run: cargo build --locked --release --all-features --all-targets |
| 48 | + |
| 49 | + - name: Cargo test |
| 50 | + run: cargo test --locked --release --all-features --all-targets |
| 51 | + |
| 52 | + - name: Cargo publish |
| 53 | + if: | |
| 54 | + contains(matrix.os, 'ubuntu') && |
| 55 | + github.repository == 'denoland/deno_core' && |
| 56 | + startsWith(github.ref, 'refs/tags/') |
| 57 | + env: |
| 58 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 59 | + run: cargo publish -p serde_v8 && cargo publish -p deno_ops && cargo publish -p deno_core |
| 60 | + |
| 61 | + - name: Get tag version |
| 62 | + if: contains(matrix.os, 'ubuntu') && startsWith(github.ref, 'refs/tags/') |
| 63 | + id: get_tag_version |
| 64 | + run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} |
| 65 | + |
0 commit comments