Skip to content

Merge pull request #55 from railsware/update-dependencies #176

Merge pull request #55 from railsware/update-dependencies

Merge pull request #55 from railsware/update-dependencies #176

Workflow file for this run

name: Validate
on: push
jobs:
# This jobs stops already running builds in current branch
# except master and tags
cleanup-runs:
name: "Cleanup running builds for current branch"
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read Node.JS version
id: versions
run: |
echo "node_version=$(cat .node-version)" >> $GITHUB_OUTPUT
- name: Install Node.JS
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions.outputs.node_version }}
- name: Restore node_modules cache
uses: actions/cache@v2
id: yarn-cache
with:
path: "**/node_modules"
key: v1-${{ runner.os }}-${{steps.versions.outputs.node_version}}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
v1-${{ runner.os }}-${{steps.versions.outputs.node_version}}-yarn-
- name: Install Javascript dependencies
run: yarn install
# LS: When we upgrade to Yarn 2, we can just have the `yarn install --immutable` command. But with Yarn 1 it does nothing.
- name: Verify that committed yarn.lock is up to date
run: |
git diff --exit-code --quiet HEAD -- yarn.lock || { echo 'Run yarn and commit changes to yarn.lock!'; false; }
- name: Test
run: |
yarn workspaces run test
- name: Validate all actions distributives are up to date
run: |
yarn workspaces run prepublish
git diff --exit-code --quiet HEAD || { echo 'Run "yarn workspaces run prepublish" and commit changes!'; false; }
- name: Save git diff
if: ${{ failure() }}
run: mkdir tmp && git diff > tmp/diff
- name: Upload git diff
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: diff_failed
path: tmp/
- name: Notify unsuccessful build
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: GA Deployer
fields: repo,author,message
mention: here
if_mention: failure,cancelled
text: ":fire:BWEEP bip bip BWEEP:fire: *${{ github.job }} ${{ job.status }}* in the '${{ github.workflow }}' workflow"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure() && github.ref == 'refs/heads/master'