From e26512afbe96084b4c87983bdf1e60975b68e6da Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 4 Apr 2023 07:19:11 -0600 Subject: [PATCH] Try Gitea CI --- .gitea/workflows/manual_npm_publish.yml | 40 +++++++++++++++++++++++++ .gitea/workflows/test.yml | 38 +++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .gitea/workflows/manual_npm_publish.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/manual_npm_publish.yml b/.gitea/workflows/manual_npm_publish.yml new file mode 100644 index 0000000..15dca63 --- /dev/null +++ b/.gitea/workflows/manual_npm_publish.yml @@ -0,0 +1,40 @@ +name: Manual npm publish + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + +jobs: + npm_publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 16.x ] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://npm.pkg.github.com' + - run: yarn + env: + NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }} + - name: Run yarn build + env: + NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }} + run: | + yarn build + - name: Configure git.vdb.to npm registry + run: | + npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/ + - name: Authenticate to git.vdb.to registry + run: | + npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" + - name: npm publish + run: npm publish + diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..f4a22bb --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,38 @@ +name: Tests +on: + pull_request: + push: + branches: + - main + - release/** + - dboreham/** + +jobs: + sdk_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Checkout laconicd + uses: actions/checkout@v3 + with: + path: "./laconicd/" + repository: cerc-io/laconicd + fetch-depth: 0 + ref: main + - name: Environment + run: ls -tlh && env + - name: build registry-cli container + run: docker build -t cerc/laconic-registry-cli:local-test --build-arg CERC_NPM_URL=https://git.vdb.to/api/packages/cerc-io/npm/ --build-arg CERC_NPM_AUTH_TOKEN="${{ secrets.GITEA_PUBLISH_TOKEN }}" . + - name: build containers scripts + working-directory: laconicd/tests/sdk_tests + run: ./build-laconicd-container.sh + - name: start laconicd container + working-directory: laconicd/tests/sdk_tests + run: docker compose up laconicd -d + + - name: Run registry-cli demo commands in registry-cli container + run : ls -tla + - name: stop containers + working-directory: laconicd/tests/sdk_tests + run: docker compose down +