<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moises</title>
    <description>The latest articles on DEV Community by Moises (@moisescp).</description>
    <link>https://dev.to/moisescp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615359%2Fbf8bf5e2-478e-44b9-8c13-49d32c9ac90d.jpeg</url>
      <title>DEV Community: Moises</title>
      <link>https://dev.to/moisescp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moisescp"/>
    <language>en</language>
    <item>
      <title>My Blog Test with Actions</title>
      <dc:creator>Moises</dc:creator>
      <pubDate>Mon, 06 Dec 2021 20:17:58 +0000</pubDate>
      <link>https://dev.to/moisescp/my-blog-test-with-actions-nio</link>
      <guid>https://dev.to/moisescp/my-blog-test-with-actions-nio</guid>
      <description>&lt;h3&gt;
  
  
  Context:
&lt;/h3&gt;

&lt;p&gt;I wanted to create a new blog about React and NextJs, ensuring that if the tests didn't pass I wouldn't be able to make the margin. Hackathon only encouraged to start the project and studies&lt;/p&gt;

&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;After using &lt;code&gt;create-next-app&lt;/code&gt;, I configure eslint and add the script command in &lt;code&gt;package.json&lt;/code&gt; with the linter and test commands &lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;

&lt;p&gt;it's a simple yaml, but it helps me a lot&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI
# Controls when the action will run.
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  pull_request:
    types: [ opened, synchronize ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  lint:
    name: Lint
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: '14.15.0'
      ##################################
      ##################################

      # Runs a single command using the runners shell
      - name: Node Version
        run: node -v
      - name: Install de dependencias
        run: yarn install
      - name: Roda o Linter!
        run: yarn lint
  unit_tests:
    name: Unit Tests
    runs-on: ubuntu-latest # The type of runner that the job will run on
    steps: # Steps represent a sequence of tasks that will be executed as part of the job
      # [Pre Build-step]
      - uses: actions/checkout@v2 ## Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/setup-node@v1
        with:
          node-version: '14.15.0'
      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
      # ####################

      # Commands that will run:
      - name: Install Packages
        run: yarn --prefer-offline

      - name: Run Unit Tests
        run: yarn test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;After that, if you want the merger to be done, only if they pass, just go to the repository &lt;code&gt;settings&lt;/code&gt;, then to the option &lt;code&gt;branches &amp;gt; add rule&lt;/code&gt;&lt;br&gt;
Once here choose the option &lt;code&gt;Require status checks to pass before merging&lt;/code&gt;. For safety I also set the &lt;code&gt;Require branches to be up to date before merging&lt;/code&gt; option.&lt;br&gt;
And finally, just type the name of the work you want to run in my case Lint and Unit Tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;It's a simple process but it has helped me a lot to get started with github actions and understand other workflows &lt;/p&gt;

</description>
      <category>actionshackathon21</category>
    </item>
  </channel>
</rss>
