[pull] main from refined-github:main #843
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
branches: | |
- '*' | |
push: | |
branches: | |
- main | |
- 'test/*' | |
jobs: | |
Security: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npx lockfile-lint --path package-lock.json --validate-https | |
Vitest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: sudo apt-get install ripgrep | |
- run: npm ci | |
- run: npm run vitest -- --exclude 'build/features*' --exclude '**/selectors*' | |
- run: npm run vitest -- selectors | |
# For some reason it fails on CI, but not locally | |
# Mentioned in https://github.com/refined-github/refined-github/issues/7747 | |
if: false | |
continue-on-error: true | |
Verify: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: npm ci | |
- run: npm run vitest -- build/features | |
- name: Leave comment | |
uses: peter-evans/create-or-update-comment@v4 | |
if: failure() && github.event_name == 'pull_request' && github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
Don't worry about fixing this yet, you can wait for the feature to be finalized before documenting it. | |
FYI: you can run `npm run fix` to automatically fix a lot of issues and update snapshots. Similar tips can be found in the [contributing wiki](https://github.com/refined-github/refined-github/wiki/Contributing). | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: npm ci | |
- run: npm run lint | |
Types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: npm ci | |
- run: npm run build:typescript | |
Build: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: npm ci | |
- run: npm run build:bundle | |
env: | |
RELATIVE_CI_STATS: true | |
- name: Send build stats to RelativeCI | |
if: matrix.os == 'ubuntu-latest' | |
uses: relative-ci/agent-action@v2 | |
with: | |
token: ${{ github.token }} | |
webpackStatsFile: ./distribution/assets/webpack-stats.json | |
key: ${{ secrets.RELATIVE_CI_KEY }} | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: refined-github | |
path: | | |
distribution | |
!./distribution/assets/webpack-stats.json | |
Safari: | |
# Disabled because it's a waste of time | |
if: false | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- run: npm ci | |
- run: npm run build:bundle | |
- uses: maxim-lobanov/setup-xcode@v1 | |
- run: npm run pack:safari |