recombine workflows

This commit is contained in:
Matt Godbolt
2021-02-13 14:38:15 -06:00
parent 239539b5c3
commit ff6105aa36
3 changed files with 43 additions and 49 deletions

View File

@@ -1,13 +1,45 @@
name: CE Deploy
name: Compiler Explorer
on:
workflow_run:
workflows: [ "Compiler Explorer" ]
types: [ completed ]
on: [ push, pull_request ]
jobs:
build-node:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
build-and-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: TEST
run: |
which npx
npx --version
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install prerequisites
run: make prereqs
- name: Build and test
run: |
npm run lint
npm run ci-test
- name: Code coverage
run: npm run codecov
build-dist-and-deploy:
needs: build-and-test
if: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
runs-on: ubuntu-20.04
steps:

View File

@@ -1,38 +0,0 @@
name: Compiler Explorer
on: [ push, pull_request ]
jobs:
build-node:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: TEST
run: |
which npx
npx --version
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install prerequisites
run: make prereqs
- name: Build and test
run: |
npm run lint
npm run ci-test
- name: Code coverage
run: npm run codecov

View File

@@ -40,9 +40,7 @@ $(NODE_MODULES): package.json | node-installed
@touch $@
WEBPACK:=./node_modules/webpack-cli/bin/cli.js
webpack: $(NODE_MODULES) ## Runs webpack (useful only for debugging webpack)
rm -rf out/dist/static out/dist/manifest.json
$(WEBPACK) $(WEBPACK_ARGS)
$(WEBPACK): $(NODE_MODULES)
lint: $(NODE_MODULES) ## Checks if the source currently matches code conventions
$(NPM) run lint
@@ -54,7 +52,9 @@ ci-lint: $(NODE_MODULES)
$(NPM) run ci-lint
node_modules: $(NODE_MODULES)
webpack: $(WEBPACK)
webpack: $(WEBPACK) ## Runs webpack (useful only for debugging webpack)
rm -rf out/dist/static out/dist/manifest.json
$(WEBPACK) $(WEBPACK_ARGS)
test: $(NODE_MODULES) ## Runs the tests
$(NPM) run test