diff --git a/.github/workflows/npm-app-build.yml b/.github/workflows/npm-app-build.yml index c5fea101..7f2efcfc 100644 --- a/.github/workflows/npm-app-build.yml +++ b/.github/workflows/npm-app-build.yml @@ -34,6 +34,65 @@ on: required: false jobs: + lint: + runs-on: ubuntu-latest + container: node:20-alpine + continue-on-error: false + outputs: + docs-present: ${{ steps.docs.outputs.present }} + steps: + - name: Install Dependencies + run: | + apk add jq tar alpine-conf git openssh curl bash + + - name: Cache nodejs deps + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm + + - uses: actions/checkout@v3 + + - name: Cache licence-check + if: ${{ inputs.licencecheck == true }} + uses: actions/cache@v3 + with: + path: /lc + key: lcc + + - name: Check licence + if: ${{ inputs.licencecheck == true }} + uses: zepben/licence-check-action@main + with: + LC_URL: ${{ secrets.LC_URL }} + PATH: ${{ inputs.sourcepath }} + + - name: Set timezone to Australia/ACT + run: | + setup-timezone -z Australia/ACT + + - name: create .npmrc + run: | + rm -rf ~/.npmrc + echo "@zepben:registry=${{ secrets.NEXUS_NPM_REPO }}" >> ~/.npmrc + echo "//mavenrepo.zepben.com/repository/zepben-npm/:_authToken=${{ secrets.CI_NPM_TOKEN }}" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_GITHUB_TOKEN }}" >> ~/.npmrc + echo "\n" >> ~/.npmrc + + - name: Install Dependencies + run: + npm install --save-dev --legacy-peer-deps + + - name: Lint + id: ci_lint + run: | + echo "Running default linting..." + if ! npm run lint; then + echo "eslint-plugin-import not found, installing and retrying..." + npm install eslint-plugin-import@latest --save-dev + npm run lint + fi + build-and-test: runs-on: ubuntu-latest container: node:20-alpine @@ -79,7 +138,8 @@ jobs: echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_GITHUB_TOKEN }}" >> ~/.npmrc echo "\n" >> ~/.npmrc - - name: Build and test + - name: Build and Test + id: build_and_test run: | echo "NPM is sensitive to .npmrc formatting; check that it has a newline at the end!!!" npm ci --unsafe-perm diff --git a/.github/workflows/npm-app-snapshot-release.yml b/.github/workflows/npm-app-snapshot-release.yml index 7b1e74cd..707b911b 100644 --- a/.github/workflows/npm-app-snapshot-release.yml +++ b/.github/workflows/npm-app-snapshot-release.yml @@ -43,6 +43,64 @@ on: required: false jobs: + lint: + runs-on: ubuntu-latest + container: node:20-alpine + continue-on-error: false + outputs: + docs-present: ${{ steps.docs.outputs.present }} + steps: + - name: Install Dependencies + run: | + apk add jq tar alpine-conf git openssh curl bash + + - name: Cache nodejs deps + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm + + - uses: actions/checkout@v3 + + - name: Cache licence-check + if: ${{ inputs.licencecheck == true }} + uses: actions/cache@v3 + with: + path: /lc + key: lcc + + - name: Check licence + if: ${{ inputs.licencecheck == true }} + uses: zepben/licence-check-action@main + with: + LC_URL: ${{ secrets.LC_URL }} + PATH: ${{ inputs.sourcepath }} + + - name: Set timezone to Australia/ACT + run: | + setup-timezone -z Australia/ACT + + - name: create .npmrc + run: | + rm -rf ~/.npmrc + echo "@zepben:registry=${{ secrets.NEXUS_NPM_REPO }}" >> ~/.npmrc + echo "//mavenrepo.zepben.com/repository/zepben-npm/:_authToken=${{ secrets.CI_NPM_TOKEN }}" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_GITHUB_TOKEN }}" >> ~/.npmrc + echo "\n" >> ~/.npmrc + + - name: Install Dependencies + run: + npm install --save-dev --legacy-peer-deps + + - name: Lint + id: ci_lint + run: | + echo "Running default linting..." + if ! npm run lint; then + echo "eslint-plugin-import not found, installing and retrying..." + npm install eslint-plugin-import@latest --save-dev + npm run lint + fi build-artifact: runs-on: ubuntu-latest outputs: diff --git a/.github/workflows/npm-lib-build.yml b/.github/workflows/npm-lib-build.yml index e91ed966..1747462f 100644 --- a/.github/workflows/npm-lib-build.yml +++ b/.github/workflows/npm-lib-build.yml @@ -29,6 +29,64 @@ on: required: false jobs: + lint: + runs-on: ubuntu-latest + container: node:20-alpine + continue-on-error: false + outputs: + docs-present: ${{ steps.docs.outputs.present }} + steps: + - name: Install Dependencies + run: | + apk add jq tar alpine-conf git openssh curl bash + + - name: Cache nodejs deps + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm + + - uses: actions/checkout@v3 + + - name: Cache licence-check + if: ${{ inputs.licencecheck == true }} + uses: actions/cache@v3 + with: + path: /lc + key: lcc + + - name: Check licence + if: ${{ inputs.licencecheck == true }} + uses: zepben/licence-check-action@main + with: + LC_URL: ${{ secrets.LC_URL }} + PATH: ${{ inputs.sourcepath }} + + - name: Set timezone to Australia/ACT + run: | + setup-timezone -z Australia/ACT + + - name: create .npmrc + run: | + rm -rf ~/.npmrc + echo "@zepben:registry=${{ secrets.NEXUS_NPM_REPO }}" >> ~/.npmrc + echo "//mavenrepo.zepben.com/repository/zepben-npm/:_authToken=${{ secrets.CI_NPM_TOKEN }}" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_GITHUB_TOKEN }}" >> ~/.npmrc + echo "\n" >> ~/.npmrc + + - name: Install Dependencies + run: + npm install --save-dev --legacy-peer-deps + + - name: Lint + id: ci_lint + run: | + echo "Running default linting..." + if ! npm run lint; then + echo "eslint-plugin-import not found, installing and retrying..." + npm install eslint-plugin-import@latest --save-dev + npm run lint + fi build-and-test: runs-on: ubuntu-latest container: node:20-alpine diff --git a/.github/workflows/npm-lib-snapshot.yml b/.github/workflows/npm-lib-snapshot.yml index 03a43380..f781b1c9 100644 --- a/.github/workflows/npm-lib-snapshot.yml +++ b/.github/workflows/npm-lib-snapshot.yml @@ -43,6 +43,64 @@ on: required: false jobs: + lint: + runs-on: ubuntu-latest + container: node:20-alpine + continue-on-error: false + outputs: + docs-present: ${{ steps.docs.outputs.present }} + steps: + - name: Install Dependencies + run: | + apk add jq tar alpine-conf git openssh curl bash + + - name: Cache nodejs deps + uses: actions/cache@v3 + with: + path: ~/.npm + key: npm + + - uses: actions/checkout@v3 + + - name: Cache licence-check + if: ${{ inputs.licencecheck == true }} + uses: actions/cache@v3 + with: + path: /lc + key: lcc + + - name: Check licence + if: ${{ inputs.licencecheck == true }} + uses: zepben/licence-check-action@main + with: + LC_URL: ${{ secrets.LC_URL }} + PATH: ${{ inputs.sourcepath }} + + - name: Set timezone to Australia/ACT + run: | + setup-timezone -z Australia/ACT + + - name: create .npmrc + run: | + rm -rf ~/.npmrc + echo "@zepben:registry=${{ secrets.NEXUS_NPM_REPO }}" >> ~/.npmrc + echo "//mavenrepo.zepben.com/repository/zepben-npm/:_authToken=${{ secrets.CI_NPM_TOKEN }}" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_GITHUB_TOKEN }}" >> ~/.npmrc + echo "\n" >> ~/.npmrc + + - name: Install Dependencies + run: + npm install --save-dev --legacy-peer-deps + + - name: Lint + id: ci_lint + run: | + echo "Running default linting..." + if ! npm run lint; then + echo "eslint-plugin-import not found, installing and retrying..." + npm install eslint-plugin-import@latest --save-dev + npm run lint + fi build-artifact: runs-on: ubuntu-latest container: node:20-alpine