ci: updated github actions ci workflow (#6314)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Phillip Barta · committed by GitHub · parent 511d9df · Browse files · 2 files·+54 added−58 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+54 added−58 removed
- other:+54 added−58 removed
Provenance
- Commit
a5cb681- Tree
bce5197- Author
Phillip Barta <barta.phillip@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
511d9df
2 files changed+54 added−58 removed
modified:.github/workflows/ci.yml+28 added-30 removed
12 unmodified lines13141516171819202122234 unmodified lines282930312932333435363735383940414232 unmodified lines75767778767779788080818283848581878283899084858687888990919293949795969910010197989910010310410510610710110210310410510610911011110710810911011311411511611111211311412 unmodified lines pull_request: paths-ignore: - '*.md'
permissions: contents: read
# Cancel in progress workflows# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new runconcurrency: group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"4 unmodified lines name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js {{ matrix.node-version }} - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 'lts/*'
- name: Install dependencies run: npm install --ignore-scripts --only=dev run: npm install --ignore-scripts --inlcude=dev
- name: Run lint run: npm run lint
32 unmodified lines echo "NPM version: $(npm -v)"
- name: Run tests shell: bash run: | npm run test-ci run: npm run test-ci cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"
- name: Collect code coverage run: | mv ./coverage "./${{ matrix.node-version }}" mkdir ./coverage mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"
- name: Upload code coverage uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4 with: name: coverage path: ./coverage name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }} path: ./coverage/lcov.info retention-days: 1
coverage: needs: test runs-on: ubuntu-latest permissions: contents: read checks: write steps: - uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install lcov shell: bash run: sudo apt-get -y install lcov - name: Install lcov shell: bash run: sudo apt-get -y install lcov
- name: Collect coverage reports uses: actions/download-artifact@v3 with: name: coverage path: ./coverage - name: Collect coverage reports uses: actions/download-artifact@v4 with: path: ./coverage pattern: coverage-node-*
- name: Merge coverage reports shell: bash run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info - name: Merge coverage reports shell: bash run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info
- name: Upload coverage report uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload coverage report uses: coverallsapp/github-action@v2 with: file: ./lcov.infomodified:.github/workflows/legacy.yml+26 added-28 removed
12 unmodified lines13 pull_request:14 paths-ignore:15 - '*.md'16 17+permissions:18+ contents: read19+20 # Cancel in progress workflows21 # in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run22 concurrency:23 group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"35 unmodified lines59 echo "NPM version: $(npm -v)"60 61 - name: Run tests62 shell: bash60- run: |61- npm run test-ci63+ run: npm run test-ci62- cp coverage/lcov.info "coverage/${{ matrix.node-version }}.lcov"64 64- - name: Collect code coverage65- run: |66- mv ./coverage "./${{ matrix.node-version }}"67- mkdir ./coverage68- mv "./${{ matrix.node-version }}" "./coverage/${{ matrix.node-version }}"69-65 - name: Upload code coverage71- uses: actions/upload-artifact@v366+ uses: actions/upload-artifact@v467 with:73- name: coverage74- path: ./coverage68+ name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }}69+ path: ./coverage/lcov.info70 retention-days: 171 72 coverage:73 needs: test74 runs-on: ubuntu-latest75+ permissions:76+ contents: read77+ checks: write78 steps:81- - uses: actions/checkout@v479+ - uses: actions/checkout@v480 83- - name: Install lcov84- shell: bash85- run: sudo apt-get -y install lcov81+ - name: Install lcov82+ shell: bash83+ run: sudo apt-get -y install lcov84 87- - name: Collect coverage reports88- uses: actions/download-artifact@v389- with:90- name: coverage91- path: ./coverage85+ - name: Collect coverage reports86+ uses: actions/download-artifact@v487+ with:88+ path: ./coverage89+ pattern: coverage-node-*90 93- - name: Merge coverage reports94- shell: bash95- run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./coverage/lcov.info91+ - name: Merge coverage reports92+ shell: bash93+ run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info94 97- - name: Upload coverage report98- uses: coverallsapp/github-action@master99- with:100- github-token: ${{ secrets.GITHUB_TOKEN }}95+ - name: Upload coverage report96+ uses: coverallsapp/github-action@v297+ with:98+ file: ./lcov.info