|
| 1 | +name: Workshops - Event Driven Architecture |
| 2 | + |
| 3 | +on: |
| 4 | + # run it on push to the default repository branch |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + paths: |
| 8 | + - "workshops/event_driven_architecture/**" |
| 9 | + # run it during pull request |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - "workshops/event_driven_architecture/**" |
| 13 | + |
| 14 | +defaults: |
| 15 | + run: |
| 16 | + # relative path to the place where source code (with package.json) is located |
| 17 | + working-directory: workshops/event_driven_architecture |
| 18 | + |
| 19 | +jobs: |
| 20 | + build-and-test-code: |
| 21 | + name: Build application code |
| 22 | + # use system defined below in the tests matrix |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + |
| 25 | + strategy: |
| 26 | + # define the test matrix |
| 27 | + matrix: |
| 28 | + # selected operation systems to run CI |
| 29 | + os: [ubuntu-latest] #, windows-latest, macos-latest] |
| 30 | + # selected node version to run CI |
| 31 | + node-version: [20.10.x] |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Check Out Repo |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Start containers |
| 38 | + run: docker compose -f "docker-compose.yml" up -d |
| 39 | + |
| 40 | + - name: Use Node.js ${{ matrix.node-version }} |
| 41 | + uses: actions/setup-node@v4 |
| 42 | + with: |
| 43 | + # use the node version defined in matrix above |
| 44 | + node-version: ${{ matrix.node-version }} |
| 45 | + |
| 46 | + - name: Install dependencies |
| 47 | + run: npm ci |
| 48 | + |
| 49 | + - name: Run linting (ESlint and Prettier) |
| 50 | + run: npm run lint |
| 51 | + |
| 52 | + - name: Build |
| 53 | + run: npm run build:ts |
| 54 | + |
| 55 | + - name: Test |
| 56 | + run: npm run test:solved |
0 commit comments