Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Oct 24, 2021
1 parent b3dd835 commit 82ecf95
Show file tree
Hide file tree
Showing 24 changed files with 29,746 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Example

on: push

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- uses: hmarr/debug-action@v2

# - uses: mxschmitt/action-tmate@v3

- name: Install npm dependencies
run: npm ci --prefix ./example

- name: Build application
run: npm run build --if-present --prefix ./example

- name: Send webpack stats to RelativeCI
uses: ./
with:
webpackStatsFile: ./example/artifacts/webpack-stats.json
key: ${{ secrets.RELATIVE_CI_KEY }}
slug: ${{ secrets.RELATIVE_CI_SLUG }}
debug: true
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ inputs:
runs:
using: "composite"
steps:
- uses: hmarr/debug-action@v2

- name: Copy webpack stats file
run: cp ${{ inputs.webpackStatsFile }} ${{ github.action_path}}/webpack-stats.json
shell: bash
Expand Down
6 changes: 6 additions & 0 deletions example/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
'@babel/preset-react',
'@babel/preset-env',
],
};
10 changes: 10 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
.DS_Store
Thumbs.db
.idea/
.vscode/
*.sublime-project
*.sublime-workspace
*.log
dist
artifacts
9 changes: 9 additions & 0 deletions example/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The MIT License

Copyright 2020 Viorel Cojocaru, contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# example-github-action

[![ci](https://github.com/relative-ci/example-github-action/workflows/ci/badge.svg)](https://github.com/relative-ci/example-github-action/actions?query=workflow%3Aci)
[![RelativeCI](https://badges.relative-ci.com/badges/o1LoGhgroz0LFHx4sTuM?branch=master)](https://app.relative-ci.com/projects/o1LoGhgroz0LFHx4sTuM)

> [@relative-ci/agent](https://github.com/relative-ci/agent) [Github Action](https://github.com/features/actions) example

## Example app

Basic webpack setup:
- `Javascript`: babel with `@babel/preset-env` and `@babel/preset-react`
- `CSS`: `postcss`(`autoprefixer`, `cssnano`), `css-modules`, `mini-css-extract`
- assets:
- `public`: `copy-webpack-plugin`
- `src`: `file-loader`
- `inline.svg`: - `svgr`
1 change: 1 addition & 0 deletions example/artifacts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Loading

0 comments on commit 82ecf95

Please sign in to comment.