diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml new file mode 100644 index 000000000..bdbb6f9ed --- /dev/null +++ b/.github/workflows/lint_and_test.yml @@ -0,0 +1,38 @@ +name: Lint and Test + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # https://github.com/actions/checkout + - name: Checkout + uses: actions/checkout@v4 + + # https://github.com/actions/setup-node + - name: Use Node.js 14 + uses: actions/setup-node@v4 + with: + node-version: '14' + + - name: Clean install NPM packages from package-lock.json + run: npm ci + + - name: Lint + run: npm run lint + + - name: Test + run: npm run test:unit + env: + CI: true + + # https://github.com/cypress-io/github-action + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + start: npm run serve + wait-on: 'http://localhost:8080' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 03b86efbb..000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish - -on: - push: - branches: - - master - -jobs: - Deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: Run npm install - run: npm ci - - - name: Build - run: | - npm run build - - - name: Commit changes - uses: EndBug/add-and-commit@v4 - with: - author_name: cc-open-source-bot - author_email: opensource@creativecommons.org - message: "Deploy site" - add: "./docs" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 4d17cd57f..000000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Lint and Test - -on: pull_request - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: Run npm install - run: npm ci - - - name: Lint - run: npm run lint - - - name: Test - run: npm run test:unit - env: - CI: true - - name: Cypress run - uses: cypress-io/github-action@v5.1.0 - with: - start: npm run serve - wait-on: 'http://localhost:8080'