-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From CircleCI to GitHub Actions (#22)
Migrate from "CircleCI" to "GitHub Actions" >>> Previous Project State The previous project setup used CircleCI (1) with API version 2.x (2) as CI/CD service. This worked great, but also came with the disadvantage of being decoupled from the repository. During "GitHub Universe 2018", the awesome new GitHub Actions (3) feature was introduced and launched as closed beta (4). Luckily "Arctic Ice Studio" was given access in order to test all the great possibilities. During the GitHub Actions stream "Now with built-in CI/CD!" (live from GitHub HQ) (5) the "Actions" update was announced and previewed showing the expansion to use "GitHub Actions" as CI/CD service described as "fast CI/CD for any OS,any language, and any cloud" (6). See the official GitHub Actions documentation (7) for details about setups, features, the configuration API and many more! >>> Project Integration The switch from "CircleCI" to "GitHub Actions" brings many advantages like a "close-to-the-source" development pipeline. Having the code and automated pipelines/workflows in one place is worth a lot. This also comes along with the perfect integrations into GitHub itself like status reports on PRs and many more possibilities like the customization and triggering of workflows through webhooks (8) for almost every event that can occur in a repository/issue/PR etc. To integrate "GitHub Actions" the previous "CircleCI" build configuration (9) was adapted and adjusted. The official `starter-workflows` (10) were used as inspiration as well as showcase projects like the Yarn "Berry" (Yarn v2) (11) also presented during the announcement livestream. Next to the `starter-workflows` repository the official "GitHub Actions" documentations (7) were the main source of information to set up the project workflows. Since "GitHub Actions" are still in closed/limited public beta, there is no support for SVG badges through shields.io. Anyway, there are (currently undocumented) official badges provided by the GitHub API that are now used until "Actions" go GA and shields.io implemens support for it: `https://github.com/{owner}/{repo}/workflows/{workflow_name}/badge.svg` Since the base actions are maintained by GitHub it should be safe to use the `master` branch instead of an version tag. This prevents the usage of outdated actions when the workflow is not updated on a regular basis. References: (1) https://circleci.com (2) https://circleci.com/docs (3) https://github.com/features/actions (4) https://github.blog/2018-10-17-action-demos (5) https://www.youtube.com/watch?v=E1OunoCyuhY (6) https://github.blog/2019-08-08-github-actions-now-supports-ci-cd (7) https://help.github.com/en/categories/automating-your-workflow-with-github-actions (8) https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events (9) https://github.com/arcticicestudio/styleguide-javascript/blob/ac611f7e342e8475767b03d95fa174aea65b39e5/.circleci/config.yml (10) https://github.com/actions/starter-workflows (11) https://github.com/yarnpkg/berry/tree/master/.github/workflows Resolves GH-21
- Loading branch information
1 parent
484c981
commit c7d663e
Showing
7 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com> | ||
# Copyright (C) 2018-present Sven Greb <development@svengreb.de> | ||
# | ||
# Project: Styleguide JavaScript | ||
# Repository: https://github.com/arcticicestudio/styleguide-javascript | ||
# License: MIT | ||
# References: | ||
# https://github.com/features/actions | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
name: Continuous Integration | ||
on: [push] | ||
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
needs: [lint] | ||
steps: | ||
- name: Print metadata and context information | ||
env: | ||
STYLEGUIDE_JAVASCRIPT_GITHUB_ACTION_CONTEXT_RUNNER: ${{ toJson(runner) }} | ||
run: | | ||
echo "Git SHA: $GITHUB_SHA" | ||
echo "Git Ref: $GITHUB_REF" | ||
echo "Workflow Actor: $GITHUB_ACTOR" | ||
echo "GitHub Action Runner: $STYLEGUIDE_JAVASCRIPT_GITHUB_ACTION_CONTEXT_RUNNER" | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
- name: Setup Node.js version 12.x | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: 12.x | ||
- name: Install Node modules | ||
run: yarn --frozen-lockfile | ||
- name: Build documentations | ||
run: yarn docs:build | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [8.x, 10.x, 11.x, 12.x] | ||
steps: | ||
- name: Print metadata and context information | ||
env: | ||
STYLEGUIDE_JAVASCRIPT_GITHUB_ACTION_CONTEXT_RUNNER: ${{ toJson(runner) }} | ||
run: | | ||
echo "Git SHA: $GITHUB_SHA" | ||
echo "Git Ref: $GITHUB_REF" | ||
echo "Workflow Actor: $GITHUB_ACTOR" | ||
echo "GitHub Action Runner: $STYLEGUIDE_JAVASCRIPT_GITHUB_ACTION_CONTEXT_RUNNER" | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
- name: "Setup Node.js version ${{ matrix.node-version }}" | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Node modules | ||
run: yarn --frozen-lockfile | ||
- name: Run linter | ||
run: yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters