-
Notifications
You must be signed in to change notification settings - Fork 249
92 lines (76 loc) · 2.25 KB
/
plugins.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Plugin Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions:
actions: write
contents: read
id-token: write
env:
CARGO_TERM_COLOR: always
jobs:
test:
if: github.actor != 'dependabot[bot]'
strategy:
fail-fast: false
matrix:
os:
[macos-latest-xlarge, ubuntu-latest-16-cores, windows-latest-16-cores]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
cancel-in-progress: true
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: plugins/package-lock.json
- name: Generate cache key
run: echo "CACHE_MONTH=$(date +'%Y-%m')" >> $GITHUB_ENV
- name: Cache qlty tools
uses: actions/cache@v3
with:
path: ~/.qlty
key: ${{ runner.os }}-qlty-${{ env.CACHE_MONTH }}
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
if: matrix.os == 'macos-latest-xlarge'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
if: matrix.os == 'windows-latest-16-cores'
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build
env:
RUST_BACKTRACE: 1
- name: Move qlty into PATH
run: echo "${{ github.workspace }}/target/debug" >> $GITHUB_PATH
- name: Check qlty version
run: qlty --version
# Login to the GitHub Container Registry to reduce trivy rate limiting errors
- name: Log in to registry
# macOS does not support Docker
if: matrix.os != 'macos-latest-xlarge'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run plugins tests
working-directory: plugins
run: |
npm ci
npm test -- --testPathIgnorePatterns=trivy