···1212docker run -d --name artifact-server -p 8082:8080 --add-host host.docker.internal:host-gateway -e AUTH_KEY=foo ghcr.io/jefuller/artifact-server:latest
1313```
14141515-Run the following **from this directory** to make use of `.actrc` and proper working directoy.
1515+Run the following **from this directory** to make use of `.actrc` and proper working directory.
1616+1717+### Test Branch Test Suite
1818+1919+```shell
2020+act -W '.github/act/testSuite.yml' -e '.github/act/actBranchEvent.json'
2121+```
16221723### Test Branch Push
1824···44504551```shell
4652act -W '.github/act/multiRunnerBakeTest.yml' -e '.github/act/actBranchEvent.json'
4747-```5353+```
+1-16
.github/act/testSuite.yml
···7788jobs:
99 test:
1010- name: Run Tests
1111- runs-on: ubuntu-latest
1212- steps:
1313- - name: Check out the repo
1414- uses: actions/checkout@v4
1515- - name: Use Node.js
1616- uses: actions/setup-node@v4
1717- with:
1818- node-version: '18.x'
1919- cache: 'npm'
2020- - name: Install dev dependencies
2121- run: npm ci
2222- - name: Build Backend
2323- run: 'npm run build:backend'
2424- - name: Test Backend
2525- run: npm run test
1010+ uses: ./.github/workflows/testAndSanity.yml
+2-20
.github/workflows/dependabotTest.yml
···11111212jobs:
1313 test:
1414- name: Run Tests and Build (sanity)
1414+ name: Tests / Build / Sanity Run
1515 if: github.actor == 'dependabot[bot]'
1616- runs-on: ubuntu-latest
1717- steps:
1818- - name: Check out the repo
1919- uses: actions/checkout@v4
2020- - name: Use Node.js
2121- uses: actions/setup-node@v4
2222- with:
2323- node-version: '18.x'
2424- cache: 'npm'
2525- - name: Install dev dependencies
2626- run: npm ci
2727- - name: Build Backend
2828- run: 'npm run build:backend'
2929- - name: Test Backend
3030- run: npm run test
3131- - name: Install Docs Deps
3232- run: npm run docs:install
3333- - name: Build
3434- run: npm run build
1616+ uses: ./.github/workflows/testAndSanity.yml
+1-19
.github/workflows/pr.yml
···12121313jobs:
1414 test:
1515- name: Run Tests
1616- runs-on: ubuntu-latest
1715 if: contains(github.event.pull_request.labels.*.name, 'safe to test')
1818- steps:
1919- - name: Check out the repo
2020- uses: actions/checkout@v4
2121- - name: Use Node.js
2222- uses: actions/setup-node@v4
2323- with:
2424- node-version: '18.x'
2525- cache: 'npm'
2626- - name: Install dev dependencies
2727- run: npm ci
2828- - name: Build Backend
2929- run: 'npm run build:backend'
3030- - name: Test Backend
3131- run: npm run test
1616+ uses: ./.github/workflows/testAndSanity.yml
32173318 release-snapshot:
3419 name: Release snapshot
···4530 - dockerfile: ./Dockerfile
4631 suffix: ''
4732 platforms: 'linux/amd64,linux/arm64'
4848-# - dockerfile: ./alpine.Dockerfile
4949-# suffix: '-alpine'
5050-# platforms: 'linux/amd64,linux/arm64'
5133 steps:
5234 - name: Set up QEMU
5335 uses: docker/setup-qemu-action@v3
+1-16
.github/workflows/publishImage.yml
···20202121jobs:
2222 test:
2323- name: Run Tests
2423 if: github.event_name != 'pull_request'
2525- runs-on: ubuntu-latest
2626- steps:
2727- - name: Check out the repo
2828- uses: actions/checkout@v4
2929- - name: Use Node.js
3030- uses: actions/setup-node@v4
3131- with:
3232- node-version: '18.x'
3333- cache: 'npm'
3434- - name: Install dev dependencies
3535- run: npm ci
3636- - name: Build Backend
3737- run: 'npm run build:backend'
3838- - name: Test Backend
3939- run: npm run test
2424+ uses: ./.github/workflows/testAndSanity.yml
40254126 push_to_registry:
4227 name: Build and push container images
+57
.github/workflows/testAndSanity.yml
···11+name: Tests and Sanity Run
22+33+on:
44+ workflow_call:
55+ inputs:
66+ node-version:
77+ description: "Node version"
88+ required: false
99+ default: '18.x'
1010+ type: string
1111+1212+jobs:
1313+ test:
1414+ name: Tests / Build / Sanity Run
1515+ runs-on: ubuntu-latest
1616+ steps:
1717+ - name: Check out the repo
1818+ uses: actions/checkout@v4
1919+ - name: Use Node.js
2020+ uses: actions/setup-node@v4
2121+ with:
2222+ node-version: ${{ inputs.node-version }}
2323+ cache: 'npm'
2424+2525+ - name: Install dev dependencies
2626+ run: npm ci
2727+ - name: Test Backend
2828+ run: npm run test
2929+3030+ - name: Install Docs Deps
3131+ run: NODE_ENV=production npm run docs:install
3232+ - name: Build
3333+ run: NODE_ENV=production npm run build
3434+3535+ # remove modules that might include dev stuff
3636+ # so that in the next step we are sure that prod-only runs work correctly
3737+ - name: Install Prod Deps
3838+ run: |
3939+ rm -rf node_modules && \
4040+ rm -rf docsite/node_modules && \
4141+ NODE_ENV=production npm ci --omit=dev
4242+4343+ # run app for 10 seconds as sanity check to see if it errors for any reason
4444+ # easy testcase for missing packages and init errors
4545+ - name: Sanity Run
4646+ run: |
4747+ set +e
4848+ export NODE_ENV=production
4949+ timeout --preserve-status 10s node node_modules/.bin/tsx src/backend/index.ts
5050+ exitcode="$?"
5151+ if [[ "$exitcode" -eq 143 ]] || [[ "$exitcode" -eq 137 ]]; then
5252+ echo "App stayed up long enough and exited with expected status"
5353+ exit 0
5454+ else
5555+ echo "App exited with unexpected code $exitcode"
5656+ exit "$exitcode"
5757+ fi