-
Notifications
You must be signed in to change notification settings - Fork 29
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
GH_action/public_repo_tests_migration_b2 #27
Changes from all commits
1227652
6a2f2aa
3df79ea
44d7a81
24f9f9c
6e8d59a
36b795f
12fdb6e
bf84400
3d70185
4889bef
758f7d8
74cbe1a
a037159
04e8ecf
5a98b04
ef09942
4fb180e
1de1790
bb4a84c
fae98bd
14a52ae
8d56c71
e5a6638
1c9a1f4
c234973
33b42a6
81d4368
25d345f
7f4e082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: SSH agent setup | ||
description: "Sets up ssh agent, add read ssh key and write ssh key" | ||
inputs: | ||
read_github_ssh_key: | ||
description: "ssh key to read other repos" | ||
required: false | ||
write_github_ssh_key: | ||
description: "ssh key to write other repos" | ||
required: false | ||
runs: | ||
using: composite | ||
steps: | ||
- name: set env | ||
shell: bash -e {0} | ||
working-directory: /tmp | ||
run: | | ||
eval $(ssh-agent) | ||
echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK | sudo tee -a $GITHUB_ENV | ||
echo SSH_AGENT_PID=$SSH_AGENT_PID | sudo tee -a $GITHUB_ENV | ||
- name: create .ssh directory | ||
shell: bash -e {0} | ||
working-directory: /tmp | ||
run: | | ||
mkdir ~/.ssh | ||
chmod 700 ~/.ssh | ||
- name: setup read ssh key file | ||
shell: bash -e {0} | ||
working-directory: /tmp | ||
if: inputs.read_github_ssh_key != '' | ||
run: | | ||
echo "${{ inputs.read_github_ssh_key }}" >> ~/.ssh/github.com.rsa | ||
chmod 600 ~/.ssh/github.com.rsa | ||
ssh-add ~/.ssh/github.com.rsa | ||
|
||
cat << EOF >> ~/.ssh/config | ||
Host github.com | ||
HostName github.com | ||
IdentitiesOnly yes | ||
IdentityFile HOME/.ssh/github.com.rsa | ||
EOF | ||
sed -i "s@HOME@$HOME/@" ~/.ssh/config | ||
chmod 600 ~/.ssh/config | ||
- name: setup write ssh key file | ||
shell: bash -e {0} | ||
working-directory: /tmp | ||
if: inputs.write_github_ssh_key != '' | ||
run: | | ||
echo "${{ inputs.write_github_ssh_key }}" >> ~/.ssh/write.github.com.rsa | ||
chmod 600 ~/.ssh/write.github.com.rsa | ||
ssh-add ~/.ssh/write.github.com.rsa | ||
|
||
cat << EOF >> ~/.ssh/config | ||
Host push.github.com | ||
HostName github.com | ||
IdentitiesOnly yes | ||
IdentityFile HOME/.ssh/write.github.com.rsa | ||
EOF | ||
sed -i "s@HOME@$HOME/@" ~/.ssh/config | ||
chmod 600 ~/.ssh/config |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Build | ||
run-name: Build | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: | ||
- 3.9.6 | ||
- 3.9.8 | ||
- 3.9.9 | ||
- 3.9.10 | ||
- 3.9.11 | ||
- 3.9.12 | ||
- 3.9.13 | ||
- 3.9.16 | ||
- 3.10.0 | ||
- 3.10.1 | ||
- 3.10.2 | ||
- 3.10.3 | ||
- 3.10.4 | ||
- 3.10.10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pipenv' | ||
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. does the setup python actions provide caching for the dependencies ? Is that why we pass cache argument ? 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. Yes, I pass cache argument there is to cache the pipenv dependencies. https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md |
||
- run: make setup | ||
- run: make test | ||
- run: make coverage | ||
release: | ||
if: github.ref == 'refs/heads/master' | ||
needs: test | ||
runs-on: ubuntu-20.04 | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9.6" | ||
- name: setup pypi | ||
run: | | ||
echo "[pypi]" >> ~/.pypirc | ||
echo "username=__token__" >> ~/.pypirc | ||
echo "password=$PYPI_TOKEN" >> ~/.pypirc | ||
- name: release | ||
run: | | ||
python3 -m pip install --upgrade twine | ||
make build | ||
python3 -m twine upload --repository pypi dist/* | ||
echo "deployed to pypi" | ||
docs-build-deploy: | ||
if: github.ref == 'refs/heads/master' | ||
needs: release | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/ssh-agent | ||
with: | ||
write_github_ssh_key: ${{ secrets.WRITE_GITHUB_SSH_KEY }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9.6" | ||
cache: 'pipenv' | ||
- run: make setup | ||
- run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "gh-pages deploy bot" | ||
make gh-pages |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Update schema flow | ||
run-name: Update schema flow | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
update_schema: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/ssh-agent | ||
with: | ||
write_github_ssh_key: ${{ secrets.WRITE_GITHUB_SSH_KEY }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9.6" | ||
- name: config git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Nobody" | ||
- name: update schema | ||
run: | | ||
git clone https://github.com/binary-com/deriv-developers-portal.git /tmp/deriv-developers-portal | ||
curl -L https://cpanmin.us | perl - --sudo App::cpanminus | ||
sudo cpanm -n Dir::Self File::Basename JSON::MaybeXS Log::Any Path::Tiny Template Syntax::Keyword::Try | ||
BINARYCOM_API_SCHEMA_PATH=/tmp/deriv-developers-portal/config/v3 perl scripts/regen-py.pl | ||
if [[ $(git diff --shortstat) == ' 2 files changed, 2 insertions(+), 2 deletions(-)' ]] | ||
then | ||
echo 'Schema no change' | ||
exit 0 | ||
fi | ||
echo "Schama updated" | ||
pip3 install bump | ||
NEXT_VER=$(bump) | ||
sed -i '/# Changelog/{s/$/\n\n## NEXTVER\n\nSync API/}' CHANGELOG.md | ||
sed -i "s/NEXTVER/$NEXT_VER/g" CHANGELOG.md | ||
git add . | ||
git commit -m 'update schema automatically' | ||
git push origin HEAD:master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we missing the setting up the ssh agent step ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job did not have any command like git push or git clone so ssh agent is not needed.