-
Notifications
You must be signed in to change notification settings - Fork 393
ci: build PR before merge to main #2743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
48b1a51
Update build workflow to remove pull request trigger
MichakrawSB 2239134
ci: add separate workflow for build
MichakrawSB 0618b51
ci: add harness
lukaszzazulak 12bb59b
ci: fix harness
MichakrawSB 10bb9a1
ci: add bash as default
MichakrawSB eda1c3c
ci: fix git clone httbin
MichakrawSB 50a0de1
ci: revert changes and try install nvm
MichakrawSB bd1c189
ci: install pip3
MichakrawSB 0e14f99
ci: remove sudo
MichakrawSB e7f276d
ci: set up Python virtual environment in CI for manual installations
MichakrawSB 1f272c1
ci: remove sudos
MichakrawSB 9dd6d91
ci: remove docker-macos and install pipenc and gunicorn step
MichakrawSB a05969d
ci: install venv
MichakrawSB daf218b
ci: fix git clone
MichakrawSB aad0c77
ci: adjust pip requirements
MichakrawSB 818e1c0
ci: fix Python environment setup and dependency installation in harne…
MichakrawSB 74f2bf0
ci: fix Python and Node.js environment setup in harness-docker job
MichakrawSB 9dca5c5
ci: check if server started
MichakrawSB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Build PR | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, edited] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: node:18.20 | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - name: restore_cache | ||
| uses: actions/cache@v4.3.0 | ||
| with: | ||
| key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
| path: node_modules/ | ||
| restore-keys: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
| - name: Install Dependencies | ||
| run: yarn --frozen-lockfile | ||
| - name: Lint the codebase | ||
| run: yarn lint | ||
| - name: Run tests | ||
| run: yarn test --colors --maxWorkers=2 | ||
| - name: Run build | ||
| run: yarn build | ||
| harness-docker: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there was also harness macos before |
||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: node:18.20 | ||
| env: | ||
| executor: docker-harness | ||
| install_manually: true | ||
| steps: | ||
| - uses: actions/checkout@v4.1.0 | ||
| - name: Install nvm | ||
| run: | | ||
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could probably use an action which sets up node/abstract logic instead of having such details within the config |
||
| export NVM_DIR="$HOME/.nvm" | ||
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" | ||
| - name: Use Node.js 18.20.1 | ||
| run: | | ||
| export NVM_DIR="$HOME/.nvm" | ||
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
| nvm install 18.20.1 | ||
| nvm alias default 18.20.1 | ||
| - name: Install Python and required packages | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y python3 python3-pip python3-venv | ||
| - name: Set up Python virtual environment | ||
| run: | | ||
| python3 -m venv venv | ||
| . venv/bin/activate | ||
| pip install --upgrade pip | ||
| pip install pipenv gunicorn | ||
| pipenv --version # Verify pipenv is installed | ||
| gunicorn --version # Verify gunicorn is installed | ||
| if: env.install_manually | ||
| - run: bash -c 'echo "0.0.0.0 httpbin.org" >> /etc/hosts' | ||
| if: env.install_manually | ||
| - run: git clone https://github.com/stoplightio/httpbin httpbin | ||
| if: env.install_manually | ||
| - run: | | ||
| cd httpbin | ||
| . ../venv/bin/activate | ||
| pipenv requirements > requirements.txt | ||
| pip3 install --no-cache-dir -r requirements.txt | ||
| pip3 install --no-cache-dir ./ | ||
| if: env.install_manually | ||
| - run: | | ||
| cd httpbin | ||
| . ../venv/bin/activate | ||
| gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & | ||
| sleep 15 # Wait for the server to start | ||
| curl -I http://0.0.0.0:80 # Test server availability | ||
| if: env.install_manually | ||
| - name: Install Dependencies | ||
| run: yarn --frozen-lockfile | ||
| - name: Create CLI binary | ||
| run: yarn build.binary | ||
| - name: Run Harness | ||
| run: yarn test.harness | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.