Skip to content

Commit

Permalink
Merge pull request #134 from NucleoidJS/implement-actions
Browse files Browse the repository at this point in the history
Implement actions
  • Loading branch information
canmingir authored Jan 18, 2024
2 parents ed381b6 + 8de83ec commit 48f6fbd
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 240 deletions.
17 changes: 13 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
"plugin:react-hooks/recommended",
"plugin:cypress/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
Expand All @@ -33,16 +34,24 @@
"react/display-name": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"eqeqeq": ["error", "always"],
"eqeqeq": [
"error",
"always"
],
"no-console": "off",
"no-eval": "error",
"no-var": "error",
"prefer-const": "error",
"sort-imports": [
"warn",
{
"memberSyntaxSortOrder": ["none", "single", "multiple", "all"]
"memberSyntaxSortOrder": [
"none",
"single",
"multiple",
"all"
]
}
]
}
}
}
33 changes: 10 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
name: Deploy
name: deploy
on:
push:
branches: [main]
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
test:
uses: NucleoidJS/actions/.github/workflows/test.yml@main
secrets: inherit

deploy:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CI: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run build
- run: aws s3 rm s3://ide.nuc.land --recursive
- run: aws s3 cp dist s3://ide.nuc.land --recursive
needs: test
uses: NucleoidJS/actions/.github/workflows/deploy.yml@main
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/land.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: land
on:
push:
branches: [main]
jobs:
test:
uses: NucleoidJS/actions/.github/workflows/test.yml@main
secrets: inherit

deploy:
needs: test
uses: NucleoidJS/actions/.github/workflows/deploy.yml@main
secrets: inherit
27 changes: 6 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
name: Test
name: test

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
CI: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run build
test:
uses: NucleoidJS/actions/.github/workflows/test.yml@main
secrets: inherit
5 changes: 5 additions & 0 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("template spec", () => {
it("passes", () => {
cy.visit("https://example.cypress.io");
});
});
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 48f6fbd

Please sign in to comment.