Skip to content

Commit

Permalink
chore: fix cis (#2188)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu authored Nov 20, 2023
1 parent c188e0b commit 725f429
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 97 deletions.
95 changes: 48 additions & 47 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,60 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v2-beta
with:
node-version: 18
- uses: actions/checkout@v4

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set git identity
run: |
git config --global user.name "Martin Adámek"
git config --global user.email "[email protected]"
- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Build & deploy docs
run: |
# install project deps
yarn
# go to website dir
cd website
# install website deps
yarn
# build and deploy the docs
yarn deploy
env:
GIT_USER: "B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
- name: Set git identity
run: |
git config --global user.name "Martin Adámek"
git config --global user.email "[email protected]"
- name: Build & deploy docs
run: |
# install project deps
yarn
# go to website dir
cd website
# install website deps
yarn
# build and deploy the docs
yarn deploy
env:
GIT_USER: 'B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}

squash:
runs-on: ubuntu-latest
needs: [ build ]
needs: [build]
steps:
- uses: actions/checkout@v4
with:
ref: 'gh-pages'
fetch-depth: 0
- uses: actions/checkout@v4
with:
ref: 'gh-pages'
fetch-depth: 0

- name: Set git identity
run: |
git config --global user.name "Martin Adámek"
git config --global user.email "[email protected]"
- name: Set git identity
run: |
git config --global user.name "Martin Adámek"
git config --global user.email "[email protected]"
- name: Squash all commits to reduce repository size
run: |
TOTAL_COMMITS="$(($(git rev-list --count HEAD)-1))"
echo "squashing $TOTAL_COMMITS commits"
git reset HEAD~$TOTAL_COMMITS
git add .
git commit --amend -m 'crawlee.dev docs'
git push --force origin gh-pages
env:
GIT_USER: "B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- name: Squash all commits to reduce repository size
run: |
TOTAL_COMMITS="$(($(git rev-list --count HEAD)-1))"
echo "squashing $TOTAL_COMMITS commits"
git reset HEAD~$TOTAL_COMMITS
git add .
git commit --amend -m 'crawlee.dev docs'
git push --force origin gh-pages
env:
GIT_USER: 'B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Setup Playwright
uses: microsoft/playwright-github-action@v1

Expand Down Expand Up @@ -87,17 +91,21 @@ jobs:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
fetch-depth: 0

- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js 20
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: 'yarn'

- uses: microsoft/playwright-github-action@v1

- name: Turbo cache
Expand Down Expand Up @@ -72,17 +76,21 @@ jobs:
- name: Checkout Source code
uses: actions/checkout@v4

- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js 20
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
Expand Down Expand Up @@ -111,17 +119,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js 20
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
Expand All @@ -147,17 +159,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Activate cache for Node.js 20
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
Expand Down
75 changes: 39 additions & 36 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,53 @@ jobs:
strategy:
fail-fast: false
matrix:
storage: [ LOCAL, MEMORY, PLATFORM ]
storage: [LOCAL, MEMORY, PLATFORM]

steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Cancel Workflow Action
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate
- uses: microsoft/playwright-github-action@v1
- name: Activate cache for Node.js 20
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
- uses: microsoft/playwright-github-action@v1

- name: Login to Apify
run: npx -y apify-cli@beta login -t ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}
- name: Turbo cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
- name: Install Dependencies
run: yarn
- name: Login to Apify
run: npx -y apify-cli@beta login -t ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}

- name: Build
run: yarn ci:build
- name: Install Dependencies
run: yarn

- name: Test with storage ${{ matrix.storage }}
run: yarn test:e2e
env:
STORAGE_IMPLEMENTATION: ${{ matrix.storage }}
- name: Build
run: yarn ci:build

- name: Test with storage ${{ matrix.storage }}
run: yarn test:e2e
env:
STORAGE_IMPLEMENTATION: ${{ matrix.storage }}

0 comments on commit 725f429

Please sign in to comment.