ci: lint & check spelling/links in guides #2
Workflow file for this run
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: Guides | |
on: | |
pull_request: | |
jobs: | |
## CHECK LINKS & LINT | |
check-links-lint: | |
name: Lint & Check Links | |
runs-on: ubuntu-latest | |
steps: | |
# SETUP & INSTALL | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-node | |
with: | |
install: false | |
- name: Install dependencies | |
run: pnpm install | |
# RUN LINT CHECK | |
- name: Lint Check | |
run: pnpm markdownlint --config .markdownlint.yaml --ignore-path .markdownlintignore '**/*.mdx' | |
# START DOCS SERVER | |
- name: Run Docs Hub Server | |
run: | | |
pnpm pm2 start 'PORT=3030 BROWSER=none npm run dev' --name 'doc-links' | |
- name: Wait for 12 seconds | |
run: sleep 12 | |
# RUN LINK CHECK | |
- uses: gaurav-nelson/[email protected] | |
with: | |
config-file: 'mlc-config.json' | |
file-extension: 'mdx' | |
use-verbose-mode: 'yes' | |
folder-path: docs/guides/docs | |
## QUICKSTART TEST | |
quickstart-test: | |
timeout-minutes: 30 | |
name: build-quickstart-contract | |
runs-on: ubuntu-latest | |
steps: | |
# SETUP | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: ./.github/actions/setup-node | |
with: | |
install: false | |
# INSTALLATIONS | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install cargo-generate | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cargo-generate | |
- name: Install Fuelup | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh | |
- name: Modify Path | |
run: echo "$HOME/.fuelup/bin:${GITHUB_PATH}" >> $GITHUB_PATH | |
# CONFIGURE FUEL TOOLCHAIN | |
- name: Set Default Beta-4 Toolchain | |
run: fuelup toolchain install beta-4 && fuelup default beta-4 | |
# BUILD & RUN QUICKSTART CONTRACT TEST | |
- name: Build Contract | |
run: forc build --path ./docs/guides/examples/quickstart/counter-contract | |
- name: Run contract tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --manifest-path ./docs/guides/examples/quickstart/counter-contract/Cargo.toml | |
- name: Check Cargo fmt & clippy | |
run: | | |
cd docs/guides/examples/quickstart/counter-contract | |
cargo fmt --all --check | |
cargo clippy --all-targets --all-features | |
# RUN QUICKSTART E2E TEST | |
- name: Run Playwright tests | |
run: xvfb-run --auto-servernum pnpm test:guides | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |