Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/andrew-polk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is your hello Github Actions file

name: Andrew

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [main]

# 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@v3

- name: Build
run: dotnet build TestReactProject
- name: Test
run: dotnet test TestReactProject

- name: Set Env Var
run: echo "setting env var"
env:
My_Var: ABC
- name: Read Env Var
run: echo "$My_Var"

- name: Set Value
run: echo '::set-output name=MY_COLOR::green'
id: color-setter
- name: Read Value
run: echo "my color is ${{ steps.color-setter.outputs.MY_COLOR }}"
# Below you can see how a second job named test could be added that runs on windows and has its own steps
# test:
# runs-on: windows-latest
#
# steps:

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# gha-practice

Github action practice repository for Language Technology conference 2022

## Setup

1. Get Added as a contributor to this repository
1. Create a branch named after your github user (or anything you like that noone else is likely to use)
2. Do not look at the grading.yml until after the session if you can help it.
Expand All @@ -12,14 +14,15 @@ Github action practice repository for Language Technology conference 2022
7. Observe how the action interacts with your PR

## Next steps - Pick from these choices, make it work, repeat

- Add a new step that runs dotnet build
- Run unit tests
- Add a new job
- Set an environment variable in one step and use it in another https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
- Set an output variable from one step and use it in another https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
- Make your action get cancelled if you push while it is still running https://docs.github.com/en/actions/using-jobs/using-concurrency
- Add a matrix and use it (build platform is an obvious use) https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
- Publish artifacts from your GHA build
- Publish artifacts from your GHA build
- Add conditions to a step https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution
- Read the docs for basic understanding: https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
- Find an interesting Action on the marketplace and use it https://github.com/marketplace?type=actions
Expand Down