From e03a9581ac7ab04fc4279327e499258029cc1944 Mon Sep 17 00:00:00 2001 From: Joe Ferner Date: Fri, 24 Nov 2023 12:48:49 +0000 Subject: [PATCH] git hub actions --- .gitattributes | 9 ++++++++ .github/workflows/master.yml | 21 +++++++++++++++++ .github/workflows/pull-requests.yml | 35 +++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/master.yml create mode 100644 .github/workflows/pull-requests.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..12b7161 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# These files will be normalized on commit (CRLF converted to LF) - asterisk is a wildcard +* text eol=lf + +# These files will NOT be normalized +*.png -text +*.gif -text +*.jpg -text +*.jpeg -text +*.ico -text diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..e484d9a --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,21 @@ +name: master +on: + push: + branches: + - master +jobs: + unit-test: + name: Unit Test + runs-on: ubuntu-latest + strategy: + matrix: + nodeVersion: [ 16, 18, 20 ] + jdkVersion: [ openjdk9, openjdk10, openjdk11, openjdk21 ] + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.nodeVersion }} + - name: Unit test with code coverage analysis + run: npm test diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml new file mode 100644 index 0000000..4e432d8 --- /dev/null +++ b/.github/workflows/pull-requests.yml @@ -0,0 +1,35 @@ +name: Pull Requests +on: + pull_request: + types: [opened, edited, reopened, synchronize] + branches: + - master +jobs: + unit-test: + name: Unit Test with Code Coverage Analysis + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Set up the Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Install cargo-make + uses: davidB/rust-cargo-make@v1 + with: + version: latest + - name: Check for formatting issues + run: cargo make format-ci + - name: Check for linting issues + run: cargo make lint + - name: Unit test with code coverage analysis + run: cargo make test-coverage-ci + - name: Upload test coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + # We specify the token below to mitigate the impact of the bug mentioned here: + # https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: lcov.info