From 879604124d987eec930e41c02adb57eceb1f2415 Mon Sep 17 00:00:00 2001 From: Patrick Mannion Date: Wed, 17 Jan 2024 07:51:14 -0700 Subject: [PATCH] removed .modl from gitignore, added base gh action yml --- .github/workflows/ci-ignition-git-module.yml | 83 ++++++++++++++++++++ .gitignore | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-ignition-git-module.yml diff --git a/.github/workflows/ci-ignition-git-module.yml b/.github/workflows/ci-ignition-git-module.yml new file mode 100644 index 0000000..548f86e --- /dev/null +++ b/.github/workflows/ci-ignition-git-module.yml @@ -0,0 +1,83 @@ +name: continuous integration - core-mes + +concurrency: + group: core-mes + cancel-in-progress: true + +on: + pull_request: + branches: + - main + push: + branches: + - main +# paths: ["./apps/core-mes"] +# workflow_dispatch: # uncomment me to have it manually trigger the gh action + +env: + REGISTRY: ghcr.io + +jobs: + continuous-integration: + name: continuous integration + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + pull-requests: write + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: setup node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: install dependencies + run: npm install + working-directory: ./apps/core-mes + + - name: build + run: npm run build + working-directory: ./apps/core-mes + + - name: test + run: npm run test-coverage + working-directory: ./apps/core-mes + + - name: Run tests + run: | + npx jest --coverage | tee ./coverage.txt && exit ${PIPESTATUS[0]} + working-directory: ./apps/core-mes + + + - name: docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/WHK01/whk-mes/core-mes + flavor: latest=true + tags: | + type=sha,prefix=sha- + type=ref,event=branch + type=ref,event=pr,prefix=pr- + type=ref,event=tag,prefix=tag- + type=raw,value=${{ github.run_id }},prefix=gh- + + - name: login to image repostiory + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: build and push + uses: docker/build-push-action@v3 + with: + context: ./apps/core-mes + file: ./apps/core-mes/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a95f268..8afa1fd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ # use IntelliJ or Eclipse as an IDE # Ignition Module files -*.modl +#*.modl # Java class files *.class