Added mockery step in CI pipeline to automatically generate mocked in… #17
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: Build and Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
container: cs3org/cs3apis-build:master | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup-ssh | |
env: | |
SSH_KEY: ${{ secrets.ssh_key}} | |
run: | | |
mkdir /root/.ssh | |
python3 -c "import os; file = open('/root/.ssh/id_rsa', 'w'); file.write(os.environ['SSH_KEY']); file.close()" | |
shasum /root/.ssh/id_rsa | |
chmod 400 /root/.ssh/id_rsa | |
stat /root/.ssh/id_rsa | |
touch /root/.ssh/known_hosts | |
chmod 400 /root/.ssh/known_hosts | |
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null | |
- name: build-and-publish | |
run: cs3apis-build -git-ssh -push-go -push-js -push-node -push-python | |
- name: run-mockery | |
run: | | |
cd build/go-cs3apis | |
git config user.email "[email protected]" | |
git config user.name "cs3org-bot" | |
go install github.com/vektra/mockery/[email protected] # Later versions are incompatible with Go 1.21 | |
mockery | |
git add . | |
git commit -m 'Generated mock interfaces for https://github.com/cern-eos/grpc-proto/tree/${{ github.sha }}' | |
git push origin main | |
- name: setup-buf | |
uses: bufbuild/buf-setup-action@v1 | |
- name: push-buf | |
uses: bufbuild/buf-push-action@v1 | |
with: | |
buf_token: ${{ secrets.BUF_TOKEN }} | |
draft: ${{ github.ref_name != 'main'}} |