diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5113b204 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build + +on: [ pull_request ] + +jobs: + build: + name: Build distribution CSS and JS + runs-on: ubuntu-20.04 + strategy: + matrix: + # TODO: Add v18 back (#374) once the docs platform is migrated to a non-Gatsby solution (#373). + # node: [ 16, 18 ] + node: [ 16 ] + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: npm + + - name: Print Node.js and npm version + run: node --version && npm --version + + - name: Install + run: npm ci + + - name: Build + run: npm run build diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..7fd329be --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,36 @@ +name: Docs + +on: [ pull_request ] + +permissions: + contents: write + +jobs: + build: + name: Build Docs + runs-on: ubuntu-20.04 + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Get cache ID + run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + + - name: Restore Cache + uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + + - name: Install MkDocs + run: pip install 'mkdocs-material>=9.0.0,<10.0.0' + + - name: Build MkDocs + run: mkdocs build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..9eea8081 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Lint + +on: [ pull_request ] + +jobs: + lint: + name: Lint + runs-on: ubuntu-20.04 + strategy: + matrix: + # TODO: Add v18 back (#374) once the docs platform is migrated to a non-Gatsby solution (#373). + # node: [ 16, 18 ] + node: [ 16 ] + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: npm + + - name: Print Node.js and npm version + run: node --version && npm --version + + - name: Install + run: npm ci + + - name: Test + run: npm run lint diff --git a/.github/workflows/release-management.yml b/.github/workflows/release-management.yml index 2c3763ff..a7e80ed2 100644 --- a/.github/workflows/release-management.yml +++ b/.github/workflows/release-management.yml @@ -23,12 +23,15 @@ jobs: - name: Install run: npm ci - - name: Build - run: docker compose run --rm node_build_site && docker compose run --rm mkdocs_build_site + - name: Lint + run: npm run lint - name: Test run: npm test + - name: Build + run: docker compose run --rm node_build_site && docker compose run --rm mkdocs_build_site + - name: Check package.json for version change id: check_package_version uses: EndBug/version-check@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59cfcbb4..c48013be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,10 @@ -name: Build and Run Tests +name: Test on: [ pull_request ] jobs: - build_and_test: - name: Build and test + test: + name: Test runs-on: ubuntu-20.04 strategy: matrix: @@ -27,8 +27,5 @@ jobs: - name: Install run: npm ci - - name: Build - run: npm run build - - name: Test run: npm test diff --git a/mkdocs.yml b/mkdocs.yml index 6f50dad1..7fc65e57 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -122,4 +122,3 @@ nav: - Composition: 'docs/contribute/composition.md' - CSS Guidelines: 'docs/contribute/css.md' - Releasing: 'docs/contribute/releasing.md' -