diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml new file mode 100644 index 0000000..d25e8e5 --- /dev/null +++ b/.github/workflows/pr_test.yml @@ -0,0 +1,72 @@ +name: PR Test +on: + workflow_dispatch: + pull_request: + branches: [main] +jobs: + metadata: + runs-on: ubuntu-latest + name: Metadata + outputs: + version: ${{ steps.version.outputs.VERSION }} + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get Version + id: version + shell: bash + run: | + echo ::set-output name=VERSION::$(git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g') + - name: ${{ steps.version.outputs.VERSION }} + shell: bash + run: | + echo ${{ steps.version.outputs.VERSION }} + + python: + name: "Python Tests" + runs-on: ubuntu-latest + needs: + - metadata + strategy: + matrix: + action: + - lint + - coverage + - security-checks + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: 3.9 + - name: Install Dependencies + run: cd api && make setup + - name: Echo dependencies + run: cd api && ./venv/bin/pip freeze + - name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }} + run: cd api && make ${{ matrix.action }} + + nodejs: + name: "NodeJs Tests" + runs-on: ubuntu-latest + needs: + - metadata + strategy: + matrix: + action: + - "test:ci" + - "build" + - "tsc:ci" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + cache: "yarn" + cache-dependency-path: webapp/yarn.lock + - name: Install Dependencies + run: cd webapp && yarn install + - name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }} + run: cd webapp && yarn ${{ matrix.action }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a1b256..f306e71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,8 +5,6 @@ on: workflow_dispatch: push: branch: [main] - pull_request: - branches: [main] jobs: metadata: runs-on: ubuntu-latest