Compare commits

..

8 Commits

Author SHA1 Message Date
Bartuss
9154c712a6 Merge 73249e10da into eed9cfe64d 2020-09-23 00:19:45 +02:00
Marcono1234
eed9cfe64d Add name for Maven example (#341) 2020-06-18 13:37:50 -04:00
Justin Hutchings
b773382817 Add CodeQL security scanning (#346) 2020-06-18 13:37:05 -04:00
Josh Gross
984ce638f0 Add note about using setup-node before cache (#351) 2020-06-15 15:55:57 -04:00
David Hadka
ff937cc950 Merge pull request #343 from actions/improve-string-split
Improve string split to handle whitespace
2020-06-02 17:41:04 -05:00
Aiqiao Yan
b8204782bb Merge pull request #329 from actions/aiyan/v2-release-doc
Update readme and examples to use v2
2020-05-26 15:35:50 -04:00
Bartuss
73249e10da - name: Cache uses: actions/cache@v1.1.2 2020-03-18 05:36:31 +00:00
Bartuss
b97b3dcb43 Create blank.yml 2020-03-18 05:35:44 +00:00
4 changed files with 95 additions and 11 deletions

33
.github/workflows/blank.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 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"
build:
# 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
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.

View File

@@ -1,23 +1,29 @@
name: "Code Scanning - Action" name: "Code scanning - action"
on: on:
push: push:
pull_request:
schedule: schedule:
- cron: '0 0 * * 0' - cron: '0 19 * * 0'
jobs: jobs:
CodeQL-Build: CodeQL-Build:
strategy: # CodeQL runs on ubuntu-latest and windows-latest
fail-fast: false
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
@@ -27,9 +33,20 @@ jobs:
# languages: go, javascript, csharp, python, cpp, java # languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below). # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v1 uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v1

31
.github/workflows/nodejs.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
CI: true

View File

@@ -120,8 +120,8 @@ steps:
We cache the elements of the Cabal store separately, as the entirety of `~/.cabal` can grow very large for projects with many dependencies. We cache the elements of the Cabal store separately, as the entirety of `~/.cabal` can grow very large for projects with many dependencies.
```yaml ```yaml
- uses: actions/cache@v2 - name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle uses: actions/cache@v2
with: with:
path: | path: |
~/.cabal/packages ~/.cabal/packages
@@ -144,7 +144,8 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
## Java - Maven ## Java - Maven
```yaml ```yaml
- uses: actions/cache@v2 - name: Cache local Maven repository
uses: actions/cache@v2
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -156,6 +157,8 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. See https://docs.npmjs.com/cli/cache#cache For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. See https://docs.npmjs.com/cli/cache#cache
If using `npm config` to retrieve the cache directory, ensure you run [actions/setup-node](https://github.com/actions/setup-node) first to ensure your `npm` version is correct.
>Note: It is not recommended to cache `node_modules`, as it can break across Node versions and won't work with `npm ci` >Note: It is not recommended to cache `node_modules`, as it can break across Node versions and won't work with `npm ci`
### macOS and Ubuntu ### macOS and Ubuntu