Skip to content

Commit

Permalink
added working directory for Yaml validation job (#70)
Browse files Browse the repository at this point in the history
* added working directory for Yaml validation job

* fix

* package version working directory

* working directory

* wd

* store artifact working directory

* remove space

* working directory for frontend

* Test image build and fix more working-direcotry

* re-disable image build when no publish

---------

Co-authored-by: Eric Durand-Tremblay <[email protected]>
  • Loading branch information
alexelie120 and etremblay authored Mar 28, 2024
1 parent 642b6f0 commit 260588b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/php-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ jobs:
working-directory: ${{ inputs.working-directory }}

- name: Yaml validation
working-directory: ${{ inputs.working-directory }}
run: php ./internals/scripts/YamlLint.php

build_backend:
Expand Down Expand Up @@ -557,6 +558,7 @@ jobs:
- name: Update package version
env:
VERSION: ${{ needs.setup.outputs.version }}
working-directory: ${{ inputs.working-directory }}
run: |
# Composer versions must match ^v?\d+(\.\d+){0,3}|^dev-
if [[ $VERSION =~ ^v?[0-9]+(\.[0-9]+){0,3}$ ]]; then
Expand All @@ -576,6 +578,7 @@ jobs:
- name: Site Config
if: inputs.site-config-path != ''
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
sudo mkdir -p $(dirname ${{ inputs.site-config-path }})
sudo cat <<EOF > /tmp/configs.yml
Expand All @@ -588,17 +591,19 @@ jobs:
- name: Generate WSDL Files
if: inputs.update-wsdl
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
./script/tool API UpdateWsdl -v
- name: Tar build output
working-directory: ${{ inputs.working-directory }}
run: tar -cvf backend-build-output.tar $(ls -d composer.json vendor/ apps/**/wsdl/*.xml 2>/dev/null)

- name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: backend-build-output
path: backend-build-output.tar
path: ${{ inputs.working-directory }}/backend-build-output.tar
retention-days: 1
if-no-files-found: error

Expand All @@ -620,6 +625,7 @@ jobs:
- name: Update package version
env:
VERSION: ${{ needs.setup.outputs.version }}
working-directory: ${{ inputs.working-directory }}
run: |
contents="$(jq ".version = \"${VERSION}\"" ./package.json)" && echo "${contents}" > ./package.json
Expand All @@ -631,9 +637,11 @@ jobs:

- name: Install NPM dependencies
uses: equisoft-actions/yarn-install@v1
with:
working-directory: ${{ inputs.working-directory }}

- name: Webpack
working-directory: .
working-directory: ${{ inputs.working-directory }}
run: |
SKIP_COMPRESSION=true
if [[ "${{ needs.setup.outputs.publishable }}" == "true" ]]; then
Expand All @@ -642,13 +650,14 @@ jobs:
NO_COMPRESS=${SKIP_COMPRESSION} yarn build:production
- name: Tar build output
working-directory: ${{ inputs.working-directory }}
run: tar -cvf frontend-build-output.tar $(ls -d package.json ${{ inputs.frontend-build-path }} 2>/dev/null)

- name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: frontend-build-output
path: frontend-build-output.tar
path: ${{ inputs.working-directory }}/frontend-build-output.tar
retention-days: 1
if-no-files-found: error

Expand Down Expand Up @@ -687,20 +696,22 @@ jobs:
uses: actions/download-artifact@v4
with:
name: backend-build-output
path: .
path: ${{ inputs.working-directory }}

- name: Un-tar backend build output
working-directory: ${{ inputs.working-directory }}
run: tar -xvf backend-build-output.tar

- name: Download frontend build output
if: inputs.frontend
uses: actions/download-artifact@v4
with:
name: frontend-build-output
path: .
path: ${{ inputs.working-directory }}

- name: Un-tar frontend build output
if: inputs.frontend
working-directory: ${{ inputs.working-directory }}
run: tar -xvf frontend-build-output.tar

- name: Determine platforms to build
Expand Down

0 comments on commit 260588b

Please sign in to comment.