chore: upgrade github actions version #165
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: Build, Lint, Test and Deploy | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
jobs: | |
build-lint-test: | |
name: Node ${{ matrix.node }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
node: | |
- 20 | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Install Node ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Linter | |
run: npm run lint | |
- name: Build Code | |
run: npm run build | |
- name: Run Unit Tests | |
run: npm run test | |
- name: Generate Coverage Report | |
run: npm run coverage | |
- name: Upload Coverage Report | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel: true | |
flag-name: Test on ${{ matrix.os }} | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: build-lint-test | |
steps: | |
- name: Let Coveralls know that all tests have finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
publish: | |
name: Publish Github Action | |
needs: | |
- build-lint-test | |
- coverage | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Update Major Tag | |
run: | | |
MAJOR_VERSION=$(git describe --tags | grep -o "v[0-9]*") | |
git config --global user.name 'HaaLeo' | |
git config --global user.email '[email protected]' | |
git tag -afm "Updated tag $MAJOR_VERSION to $(git describe --tags)" $MAJOR_VERSION | |
git push --tags --force |