save html site to output file #31
This file contains hidden or 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: "Flawless Integration" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
integration: | |
name: Analyze Integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install Dependencies | |
run: npm i | |
- name: Execute Rollup Script | |
run: npm run rollup | |
- name: Publish Repository to Yalc | |
run: npx yalc publish | |
- name: Create Integration Project | |
run: npx create-react-app integration --template typescript | |
- name: Use Package In Integration Project | |
run: | | |
cd integration | |
npx yalc add fetch-loading | |
npm i | |
cat package.json | grep fetch-loading || exit 1 | |
- name: Override App.jsx | |
run: | | |
cat <<EOF > integration/src/App.tsx | |
import { FetchLoading } from 'fetch-loading' | |
const App = () => { | |
return <FetchLoading /> | |
} | |
export default App | |
EOF | |
- name: Build Integration Project | |
run: | | |
cd integration | |
npm run build || exit 1 | |
- name: Start React App | |
run: | | |
cd integration | |
npm start & | |
sleep 60 | |
curl http://localhost:3000 -o output.html || exit 1 | |
- name: Validate Rendered Output | |
run: | | |
cd integration | |
grep "fetch-loading" output.html || (cat output.html && exit 1) |